Skip to main content

capitalize

Function capitalize 

Source
pub fn capitalize<D: Dimension>(
    a: &StringArray<D>,
) -> FerrayResult<StringArray<D>>
Expand description

Capitalize each string element: the first character is titlecased and the rest is lowercased (final-sigma aware), matching Python str.capitalize.

The first character uses the Unicode titlecase mapping (->Fi, ß->Ss); the tail is the whole-string lowercase with the first character’s lowercase span removed, so the final-sigma decision sees the (cased) first character as preceding context.

§Errors

Returns an error if the internal array construction fails.