</head> <body> <h1>StringLower / StringUpper</h1> <p>Converts a string to lowercase or uppercase.</p> <pre class="Syntax"> <span class="func">StringLower</span>, OutputVar, InputVar <span class="optional">, T</span> <span class="func">StringUpper</span>, OutputVar, InputVar <span class="optional">, T</span> </pre> <h2 id="Parameters">Parameters</h2> <dl> <dt>OutputVar</dt> <dd><p>The name of the variable in which to store newly converted string.</p></dd> <dt>InputVar</dt> <dd><p>The name of the variable whose contents will be read from. Do not enclose the name in percent signs unless you want the <em>contents</em> of the variable to be used as the name.</p></dd> <dt>T</dt> <dd><p>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".</p></dd> </dl> <h2 id="Remarks">Remarks</h2> <p>To detect whether a character or string is entirely uppercase or lowercase, use <a href="IfIs.htm">"if var is [not] upper/lower</a>".</p> <p>For this and all other commands, <em>OutputVar</em> is allowed to be the same variable as an <em>InputVar</em>.</p> <p><span class="ver">[v1.1.20+]:</span> <a href="Format.htm">Format()</a> can also be used for case conversions, as shown below:</p> <pre>MsgBox % Format("{:U}, {:L} and {:T}", "upper", "LOWER", "title")</pre> <h2 id="Related">Related</h2> <p><a href="Format.htm">Format()</a>, <a href="IfInString.htm">IfInString</a>, <a href="StringGetPos.htm">StringGetPos</a>, <a href="StringMid.htm">StringMid</a>, <a href="StringTrimLeft.htm">StringTrimLeft</a>, <a href="StringTrimLeft.htm">StringTrimRight</a>, <a href="StringLeft.htm">StringLeft</a>, <a href="StringLeft.htm">StringRight</a>, <a href="StringLen.htm">StringLen</a>, <a href="StrReplace.htm">StrReplace()</a>, <a href="StringReplace.htm">StringReplace</a></p> <h2 id="Examples">Examples</h2> <div class="ex" id="ExLower"> <p><a class="ex_number" href="#ExLower"></a> Converts to lower case and stores the string "this is a test." in <var>String1</var>.</p> <pre>String1 := "This is a test." StringLower, String1, String1 <em>; i.e. output can be the same as input.</em></pre> </div> <div class="ex" id="ExUpper"> <p><a class="ex_number" href="#ExUpper"></a> Converts to upper case and stores the string "THIS IS A TEST." in <var>String2</var>.</p> <pre>String2 := "This is a test." StringUpper, String2, String2</pre> </div> <div class="ex" id="ExTitle"> <p><a class="ex_number" href="#ExTitle"></a> Converts to title case and stores the string "This Is A Test." in <var>String3</var>. Note that the same effect would be achieved by using StringLower instead of StringUpper.</p> <pre>String3 := "This is a test." StringUpper, String3, String3, T</pre> </div> </body> </html>