Converting a character to upper case in string

Laurent Tréguier laurent.treguier.sink at gmail.com
Fri Sep 21 13:54:37 UTC 2018


On Friday, 21 September 2018 at 13:32:54 UTC, NX wrote:
> On Friday, 21 September 2018 at 12:34:12 UTC, Laurent Tréguier 
> wrote:
>> I would probably go for std.utf.decode [1] to get the 
>> character and its length in code units, capitalize it, and 
>> concatenate the result with the rest of the string.
>>
>> [1] https://dlang.org/phobos/std_utf.html#.decode
>
> So by this I assume it is sufficient to work with dchars rather 
> than graphemes?

 From what I've tested; it seems sufficient. I might be wrong 
though, I'm no unicode expert. It might still be a good idea to 
have a look at grapheme related functions.


More information about the Digitalmars-d-learn mailing list