Reading a file of words line by line

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jan 15 20:53:59 UTC 2020


On Wed, Jan 15, 2020 at 07:50:31PM +0000, mark via Digitalmars-d-learn wrote:
[...]
> Why did you use string.count rather than string.length?

The .length of a `string` type is the number of bytes that it occupies,
which is not necessarily the same thing as the number of characters in
the string. E.g., if you receive a Unicode string, there may be
multi-byte characters in it.


T

-- 
A computer doesn't mind if its programs are put to purposes that don't match their names. -- D. Knuth


More information about the Digitalmars-d-learn mailing list