Method Reference: string.upper

string: newstr = upper (str)

Convert contents of string array to upper case.

newstr = upper (str) converts all lower case characters in every element of the string array str to upper case. newstr is a string array of the same size as str.

Source Code: string

Example: 1

upper converts each string to upper case.

 s = string ({'Hello'; 'World'})
s =
  2x1 string array

    "Hello"    
    "World"
 upper (s)
ans =
  2x1 string array

    "HELLO"    
    "WORLD"