Function capitalizeWords

  • Capitalizes the first letter of each word. If allOthersLowerCase is true, then all characters other than the first character of each word will also be changed to lower case.

    Example

    import * as S from "flurp/string";

    const firstCap = S.capitalizeWords();
    const firstCapOthersLower = S.capitalizeWords(true);
    firstCap("weaSEL and FERret"); // "WeaSEL And FERret"
    firstCapOthersLower("weaSEL and FERret")); // "Weasel And Ferret"

    Parameters

    • allOthersLowerCase: boolean = false

    Returns ((s: string) => string)

      • (s: string): string
      • Parameters

        • s: string

        Returns string