to delete the '\0' characters

Salih Dincer salihdb at hotmail.com
Thu Sep 22 10:53:32 UTC 2022


Is there a more accurate way to delete the '\0' characters at the 
end of the string? I tried functions in this module: 
https://dlang.org/phobos/std_string.html

```d
auto foo(string s)
{
   string r;
   foreach(c; s)
   {
     if(c > 0)
     {
       r ~= c;
     }
   }
   return r;
}
```

SDB at 79



More information about the Digitalmars-d-learn mailing list