On Thursday, 22 September 2022 at 15:22:06 UTC, Ali Çehreli wrote:
On 9/22/22 08:19, Ali Çehreli wrote:
> ```d
> string noZeroes(string s)
> {
>      return s.byCodeUnit.filter!(c => c != '\0');
> }
> ```
That won't compile; the return type must be 'auto'.

Ali

Thank you for all the valuable information you wrote. I chose to split because the '\0' are at the end of the string:

```d
string splitz(string s)
{
  import std.string : indexOf;
  size_t seekPos = s.indexOf('\0');
  return s[0..seekPos];
}
```

SDB@79

Reply via email to