Tweakr
    Preparing search index...

    Function capitalize

    • Capitalizes the first character of a string.

      If the string is empty, it returns an empty string.

      Parameters

      • str: string

        The input string.

      Returns string

      The input string with the first character converted to uppercase.

      1.1.0

      capitalize('hello'); // 'Hello'
      capitalize('world'); // 'World'
      capitalize(''); // ''