PageRenderTime 25ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/commands/StringLower.htm

https://github.com/Lexikos/AutoHotkey_L-Docs
HTML | 64 lines | 52 code | 12 blank | 0 comment | 0 complexity | 2772b6aceae30855c57440fd66ea0fcc MD5 | raw file
  1. <!DOCTYPE HTML>
  2. <html lang="en">
  3. <head>
  4. <title>StringLower / StringUpper - Syntax &amp; Usage | AutoHotkey</title>
  5. <meta name="description" content="The StringLower and StringUpper commands convert a string to lowercase or uppercase." />
  6. <meta name="ahk:equiv-v2" content="commands/StrLower.htm" />
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <link href="../static/theme.css" rel="stylesheet" type="text/css" />
  10. <script src="../static/content.js" type="text/javascript"></script>
  11. </head>
  12. <body>
  13. <h1>StringLower / StringUpper</h1>
  14. <p>Converts a string to lowercase or uppercase.</p>
  15. <pre class="Syntax">
  16. <span class="func">StringLower</span>, OutputVar, InputVar <span class="optional">, T</span>
  17. <span class="func">StringUpper</span>, OutputVar, InputVar <span class="optional">, T</span>
  18. </pre>
  19. <h2 id="Parameters">Parameters</h2>
  20. <dl>
  21. <dt>OutputVar</dt>
  22. <dd><p>The name of the variable in which to store newly converted string.</p></dd>
  23. <dt>InputVar</dt>
  24. <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>
  25. <dt>T</dt>
  26. <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>
  27. </dl>
  28. <h2 id="Remarks">Remarks</h2>
  29. <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>
  30. <p>For this and all other commands, <em>OutputVar</em> is allowed to be the same variable as an <em>InputVar</em>.</p>
  31. <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>
  32. <pre>MsgBox % Format("{:U}, {:L} and {:T}", "upper", "LOWER", "title")</pre>
  33. <h2 id="Related">Related</h2>
  34. <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>
  35. <h2 id="Examples">Examples</h2>
  36. <div class="ex" id="ExLower">
  37. <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>
  38. <pre>String1 := "This is a test."
  39. StringLower, String1, String1 <em>; i.e. output can be the same as input.</em></pre>
  40. </div>
  41. <div class="ex" id="ExUpper">
  42. <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>
  43. <pre>String2 := "This is a test."
  44. StringUpper, String2, String2</pre>
  45. </div>
  46. <div class="ex" id="ExTitle">
  47. <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>
  48. <pre>String3 := "This is a test."
  49. StringUpper, String3, String3, T</pre>
  50. </div>
  51. </body>
  52. </html>