Title stata.com
strupper( ) Convert string to uppercase (lowercase)
Syntax Description Remarks and examples Conformability
Diagnostics Also see
Syntax
string matrix strupper(string matrix s)
string matrix strlower(string matrix s)
string matrix strproper(string matrix s)
Description
strupper(s) returns s, converted to uppercase.
strlower(s) returns s, converted to lowercase.
strproper(s) returns a string with the first letter capitalized and any other letters capitalized that
immediately follow characters that are not letters; all other letters are converted to lowercase.
When s is not a scalar, these functions return element-by-element results.
Remarks and examples stata.com
strproper("mR. joHn a. sMitH") returns Mr. John A. Smith.
strproper("jack o’reilly") returns Jack O’Reilly.
strproper("2-cent’s worth") returns 2-Cent’S Worth.
Also, Stata understands strupper(), strlower(), and strproper() as synonyms for its own
upper(), lower(), and proper() functions, so you can use the str*() names in both your Stata
and Mata code.
Conformability
strupper(s), strlower(s), strproper(s):
s: r × c
result: r × c
Diagnostics
None.
1
2 strupper( ) Convert string to uppercase (lowercase)
Also see
[M-4] string String manipulation functions