StrLower / StrUpper / StrTitle

Converts a string to lowercase, uppercase or title case.

NewString := StrLower(String)
NewString := StrUpper(String)
NewString := StrTitle(String)

Parameters

String

Type: String

The string to convert.

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")

InStr, SubStr, StrLen, StrReplace

Examples

Converts the string to lowercase and stores "this is a test." in String1.

String1 := "This is a test."
String1 := StrLower(String1)  ; i.e. output can be the same as input.

Converts the string to uppercase and stores "THIS IS A TEST." in String2.

String2 := "This is a test."
String2 := StrUpper(String2)

Converts the string to title case and stores "This Is A Test." in String3.

String3 := "This is a test."
String3 := StrTitle(String3)