syntactic.sentence_case¶
- syntactic.sentence_case(obj: str | list[str], strict: bool = False) list[str]¶
Convert strings to sentence case.
Capitalizes the first letter of the first word. Subsequent words are lowercased unless they appear to be acronyms (all-caps, mixed case with multiple uppercase letters, etc.).
- Parameters:
- Returns:
Sentence-cased string(s).
- Return type:
Examples
>>> sentence_case(["hello world", "FOO BAR"]) ['Hello world', 'FOO BAR'] >>> sentence_case(["hello world", "FOO BAR"], strict=True) ['Hello world', 'Foo bar']