length of string result not as expected

jicman cabrera at wrc.xerox.com
Tue Aug 13 19:53:34 PDT 2013


Greetings.

import std.stdio;

void main()
{
   char[] str = "不良反應事件和產品客訴報告"; // 13 chinese characters...
   writefln(str.length);
}

this program returns 39.  I expected to return 13.  How do I know 
the exact length of the characters that I have in a char[] 
variable?  Thanks.

josé


More information about the Digitalmars-d-learn mailing list