String case: Difference between revisions
→{{header|Lua}}: add short form and Unicode limitation
(add Crystal) |
(→{{header|Lua}}: add short form and Unicode limitation) |
||
Line 1,999:
=={{header|Lua}}==
<syntaxhighlight lang="lua">str = "alphaBETA"
print( string.upper(str) )▼
print( string.
print ( str:upper() ) -- ALPHABETA
print ( str:lower() ) -- alphabeta
</syntaxhighlight>
The [https://www.lua.org/pil/20.html string library] properly works only for ASCII and extended ASCII (depending on the locals) ranges but not for Unicode.
<syntaxhighlight lang="lua">print ( string.upper("ação") ) -- returns AçãO instead of AÇÃO
print ( string.upper("ĥåçýджк") ) -- returns ĥåçýджк instead of ĤÅÇÝДЖК
</syntaxhighlight>
=={{header|M4}}==
|