to_titlecase

Function to_titlecase 

Source
pub fn to_titlecase(c: char) -> [char; 3]
Expand description

Accepts a char and returns the Unicode title case for that character as a 3 char array.

§Examples

If the character is already titlecase then it will return itself:

use unicode_titlecase::to_titlecase;
assert_eq!(to_titlecase('A'), ['A', '\0', '\0']);

Single-char characters are mapped:

use unicode_titlecase::to_titlecase;
assert_eq!(to_titlecase('DŽ'), ['Dž', '\0', '\0']);

Multi-char ligatures are converted:

use unicode_titlecase::to_titlecase;
assert_eq!(to_titlecase('ffl'), ['F', 'f', 'l']);

Locale is ignored:

use unicode_titlecase::to_titlecase;
assert_eq!(to_titlecase('i'), ['I', '\0', '\0']);

§Locale

This function is not locale specific. Unicode special casing has rules for tr and az that this function does not take into account. For tr and az locales use to_titlecase_tr_or_az