Function roe::to_titlecase
source · pub fn to_titlecase(c: char) -> [char; 3]
Expand description
Take a char
and return its Unicode titlecase as 3 char
s.
Trailing NUL bytes in the returned array should be ignored.
§Examples
use roe::to_titlecase;
assert_eq!(to_titlecase('DŽ'), ['Dž', '\0', '\0']);
// Ligatures
assert_eq!(to_titlecase('ffl'), ['F', 'f', 'l']);
// Locale is ignored
assert_eq!(to_titlecase('i'), ['I', '\0', '\0']);
// A character already titlecased map to itself
assert_eq!(to_titlecase('A'), ['A', '\0', '\0']);