pols-utils - v5.3.11
    Preparing search index...

    Function capitalize

    • Capitalizes the first letter of each word in a string.

      Parameters

      • value: string

        The target string.

      • toLowerFirst: boolean = true

        If true, converts the string to lowercase before capitalizing.

      Returns string

      A new string with the first letter of each word capitalized.

      console.log(PUtilsString.capitalize('Hi user!')) // 'Hi User!'
      console.log(PUtilsString.capitalize('Hi JEAN!')) // 'Hi Jean!'
      console.log(PUtilsString.capitalize('hi JEAN!', false)) // 'Hi JEAN!'