StringLower / StringUpper

AutoHotkey

StringLower / StringUpper

Converts a string to lowercase or uppercase.

StringLower, OutputVar, InputVar [, T]
StringUpper, OutputVar, InputVar [, T]

Parameters

OutputVar

The name of the variable in which to store newly converted string.

InputVar

The name of the variable whose contents will be read from. Do not enclose the name in percent signs unless you want the contents of the variable to be used as the name.

T

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

Remarks

To detect whether a character or string is entirely uppercase or lowercase, use "if var is [not] upper/lower".

For this and all other commands, OutputVar is allowed to be the same variable as an InputVar.

[v1.1.20+]: Format() can also be used for case conversions, as shown below:

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

Related

Format(), IfInString, StringGetPos, StringMid, StringTrimLeft, StringTrimRight, StringLeft, StringRight, StringLen, StringReplace

Example

StringUpper, String1, String1  ; i.e. output can be the same as input.
StringLower, String2, String2