pub fn titlecase(slice: &[u8], options: TitlecaseMode) -> Titlecase<'_> ⓘ
Expand description
Returns an iterator that yields a copy of the bytes in the given slice with the leading letter replaced with its titlecase counterpart and all remaining letters replaced with their lowercase counterparts.
This function treats the given slice as a conventionally UTF-8 string. UTF-8 byte sequences are converted to their Unicode titlecase equivalents. Invalid UTF-8 byte sequences are yielded as is.
The case mapping mode is determined by the given TitlecaseMode
. See its
documentation for details on the available case mapping modes.
§Panics
Not all TitlecaseMode
s are currently implemented. This function will
panic if the caller supplies Turkic titlecasing mode.