upper

Purpose

Converts a string, matrix of character data, or string array to uppercase.

Format

y = upper(x)
Parameters:x (string, NxK matrix, dataframe, or string array) – the character data to be converted to uppercase.
Returns:y (string or NxK matrix or string array) – containing the uppercase equivalent of the data in x.

Examples

// Load example dataframe
rep78 = loadd(getGAUSSHome("examples/auto2.dta"), "rep78");

print rep78[1:4];
  rep78
Average
Average
      .
Average
rep78_u = upper(rep78);
print rep78_u[1:4];
  rep78
AVERAGE
AVERAGE
      .
AVERAGE
// Create a lowercase string
x = "uppercase";

// Convert the string to upper case
y = upper(x);

// Adding the '$' tells GAUSS to treat the data as character
// data
print $y;

This code produces:

UPPERCASE

See also

Functions lower()