Utility TypeScript @ 2.0.0-beta
    Preparing search index...

    Function toTitleCase

    • Converts the given string to title case.

      Parameters

      • input: string

        String to convert.

      Returns string

      Title case version of the input string.

      export function toTitleCase( input: string ): string {

      return input.replace(
      /\w\S*/g,
      ( s ) => s.charAt( 0 ).toUpperCase() + s.slice( 1 ).toLowerCase()
      );
      }