StrLower / StrUpper

Converts a string to lowercase or uppercase.

NewString := StrLower(String , "T")
NewString := StrUpper(String , "T")

Parameters

String

Type: String

The string to convert.

T

Type: String

If this parameter is the letter T, the string will be converted to title case. For example, "GONE with the WIND" would become "Gone With The Wind".

Return Value

Type: String

These functions return the newly converted version of the specified string.

Remarks

To detect whether a character or string is entirely uppercase or lowercase, use the IsUpper, IsLower or RegExMatch function. For example:

var := "abc"
if isUpper(var)
    MsgBox "var is empty or contains only uppercase characters."
if isLower(var)
    MsgBox "var is empty or contains only lowercase characters."
if RegExMatch(var, "^[a-z]+$")
    MsgBox "var is not empty and contains only lowercase ASCII characters."
if !RegExMatch(var, "[A-Z]")
    MsgBox "var does not contain any uppercase ASCII characters."

Format can also be used for case conversions, as shown below:

MsgBox Format("{:U}, {:L} and {:T}", "upper", "LOWER", "title")

Related

InStr, SubStr, StrLen, StrReplace

Examples

#1

String1 := StrUpper(String1)  ; i.e. output can be the same as input.
String2 := StrLower("ABC")  ; String2 now contains "abc"