what exactly is string length?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Apr 2 05:18:49 UTC 2021


On Fri, Apr 02, 2021 at 05:05:21AM +0000, mw via Digitalmars-d-learn wrote:
[...]
> This is just an example, what if the exact length is not known
> statically, is there a functions to trim the `\0`s?

What about `s.until('\0')`?

Example:

	auto s = "abc\0\0\0def";
	auto t = "blah" ~ s.until('\0').array ~ "boo";


T

-- 
What do you call optometrist jokes? Vitreous humor.


More information about the Digitalmars-d-learn mailing list