Phaser API Documentation

  Version: 

Member of: Phaser.Utils.String

<static> UppercaseFirst(str)

Description:

Capitalizes the first letter of a string if there is one.

Parameters:

name type description
str string

The string to capitalize.

Returns:
Description:

A new string, same as the first, but with the first letter capitalized.

Type:
  • string
Examples:
UppercaseFirst('abc');
// returns 'Abc'
UppercaseFirst('the happy family');
// returns 'The happy family'
UppercaseFirst('');
// returns ''
Since: 3.0.0