toString issue
Oskar Linde
oskar.lindeREM at OVEgmail.com
Mon Oct 2 07:45:00 PDT 2006
Hasan Aljudy wrote:
> Derek Parnell wrote:
>> foreach(int i, dchar c; text)
>> {
>> bool isLetter = isUniAlpha( c );
>> ...
>> }
>>
>>
>
> I know, but that's still a work-around. What if you need to iterate back
> and forth? You're gonna need to convert it to dchar[] (or wchar[]).
>
> However, that brings up a good point:
> Notice how foreach allows to iterate a string by Unicode characters
> (a.k.a code-points)? Shouldn't this kind of iteration be supported
> outside of foreach as well?
see std.utf.decode and std.utf.stride.
/Oskar
More information about the Digitalmars-d
mailing list