StringLower / StringUpper

문자열을 소문자 또는 대문자로 변환합니다.

StringLower, OutputVar, InputVar , T
StringUpper, OutputVar, InputVar , T

매개변수

OutputVar

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

InputVar

The name of the input variable whose contents will be read from. 이름을 퍼센트 사인으로 둘러 싸지 마십시오. 변수의 내용을 이름으로 사용하고 싶다면 예외입니다.

T

이 매개변수가 기호 T이면, 문자열은 제목 격으로 변환됩니다. 예를 들어, "GONE with the WIND"는 "Gone With The Wind"이 됩니다.

논평

문자 또는 문자열이 전체적으로 대문자인지 아니면 소문자인지 탐지하려면, "if var is [not] upper/lower"를 사용하십시오.

이 명령어와 다른 모든 명령어에 대하여, OutputVarInputVar와 같은 변수가 되어도 허용합니다.

[v1.1.20+]: 아래에 보여주는 바와 같이 Format()도 대소문자 변환에 사용할 수 있습니다:

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

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

예제

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

String1 := "This is a test."
StringLower, String1, String1  ; 즉, 출력은 입력과 같을 수 있습니다.

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

String2 := "This is a test."
StringUpper, String2, String2

Converts to title case and stores the string "This Is A Test." in String3. Note that the same effect would be achieved by using StringLower instead of StringUpper.

String3 := "This is a test."
StringUpper, String3, String3, T