Function titleCase

  • Convert a string to PascalCase by capitalizing the first letter of each word.

    Parameters

    • str: string

      The input string.

    Returns string

    The string converted to PascalCase.

    Example

    // Returns 'HelloWorld'
    titleCase('hello world');

    // Returns 'Hello-world'
    titleCase('hello-world');

    // Returns 'HelloWorld'
    titleCase(' hello world ');

Generated using TypeDoc