This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Convert string to uppercase


  • newTxt = upper(txt)


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


collapse all

txt = 'Hello, World.';
newTxt = upper(txt)
newTxt =


Starting in R2016b, you can create string arrays using the string function.

Convert a string array to contain uppercase characters.

txt = string({'The SOONER,';'the BETTER.'})
txt = 

  2×1 string array

    "The SOONER,"
    "the BETTER."

newTxt = upper(txt)
newTxt = 

  2×1 string array


Text processing functions, such as strfind and regexp, accept string arrays as inputs. Other functions, such as addpath, do not.

Related Examples

Input Arguments

collapse all

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


Data Types: string | char | cell

More About

collapse all

Tall Array Support

This function fully supports tall arrays. For more information, see Tall Arrays.


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®.

See Also

| | | |

Introduced before R2006a

Was this topic helpful?