3 ms·
Guess what: x.toUpperCase().length === x.length is false when x = 'ß' I guess another falsehood programmers believe about strings is that length i
by quickthrower2 4y ago
Guess what:
x.toUpperCase().length === x.length
is false
when
x = 'ß'
I guess another falsehood programmers believe about strings is that length is not changed by toUpperCase()!
- kevin_thibedeau 4y agoThere is a capitol ẞ now so it will depend on normalization rules.
- tragomaskhalos 4y agoRust's char::to_uppercase returns an iterator to cover these sorts of shenanigans : https://doc.rust-lang.org/stable/std/primitive.char.html#method.to_uppercase https://doc.rust-lang.org/stable/std/primitive.char.html#met...