Main Content

upper

Convert strings to uppercase

Description

newStr = upper(str) converts all lowercase characters in str to the corresponding uppercase characters and leaves all other characters unchanged.

Examples

collapse all

upper('Hello, World.')
ans = 
'HELLO, WORLD.'

Convert a string array to contain uppercase characters.

str = ["The SOONER,";"the BETTER."]
str = 2x1 string
    "The SOONER,"
    "the BETTER."

newStr = upper(str)
newStr = 2x1 string
    "THE SOONER,"
    "THE BETTER."

Input Arguments

collapse all

Input array, specified as a string array, character array, or cell array of character vectors.

Tips

For character arrays, the upper function supports the character sets:

  • PC: Windows® Latin-1

  • Other: ISO® Latin-1 (ISO 8859-1)

For string arrays, the upper function supports Unicode®.

Extended Capabilities

Version History

Introduced before R2006a