Library API
    Preparing search index...

    Function toTitleCase

    • Converts a string to title case, where only the first letter of the entire string is capitalized. This is locale-aware if a locale is provided.

      Parameters

      • str: string

        The string to convert

      • Optionallocale: string

        Optional locale for capitalization rules

      Returns string

      The title-cased string

      toTitleCase('HELLO WORLD'); // 'Hello world'