@jossmac/lil-libs
    Preparing search index...

    Function titleCase

    • Converts a string to title case, capitalizing content words while keeping articles, prepositions, and conjunctions lowercase unless they are the first or last word.

      • value: string

        Input split on case transitions, whitespace, and punctuation.

      • options: CaseOptions = {}

        Optional locale for case mapping (defaults to system locale).

      Title-cased phrase; articles, prepositions, and conjunctions stay lowercase except as the first or last word.

      titleCase("a comparison of cases"); // "A Comparison of Cases"
      titleCase("the wind in the willows"); // "The Wind in the Willows"
      titleCase("lost in translation"); // "Lost in Translation" ("in" stays lowercase)