Function upperFirst

  • Converts the first character of string to upper case.

    Parameters

    • str: string

      The string that is to be changed

    Returns string

    • The converted string.
    const convertedStr1 = upperFirst('fred') // returns 'Fred'
    const convertedStr2 = upperFirst('Fred') // returns 'Fred'
    const convertedStr3 = upperFirst('FRED') // returns 'FRED'