upper - Convert strings to uppercase - MATLAB (original) (raw)
Main Content
Convert strings to uppercase
Syntax
Description
newStr = upper([str](#bu55fwd-txt))
converts all lowercase characters in str
to the corresponding uppercase characters and leaves all other characters unchanged.
Examples
Convert a string array to contain uppercase characters.
str = ["The SOONER,";"the BETTER."]
str = 2×1 string "The SOONER," "the BETTER."
newStr = 2×1 string "THE SOONER," "THE BETTER."
Input Arguments
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
Theupper
function fully supports tall arrays. For more information, see Tall Arrays.
Usage notes and limitations:
- Input array must be a string scalar or a character array.
- Input values must be in the range 0–127.
Version History
Introduced before R2006a