String case: Difference between revisions

Content added Content deleted
(Add lang example)
No edit summary
Line 2,063: Line 2,063:
print ( string.upper("ĥåçýджк") ) -- returns ĥåçýджк instead of ĤÅÇÝДЖК
print ( string.upper("ĥåçýджк") ) -- returns ĥåçýджк instead of ĤÅÇÝДЖК
</syntaxhighlight>
</syntaxhighlight>

=={{header|M2000 Interpreter}}==

<syntaxhighlight lang="m2000 interpreter">
Module stringcase {
string s="alphaBETA", s1=s, c="!@@@@<"
print ucase$(s)="ALPHABETA"
print lcase$(s)="alphabeta"
s=str$(s+"ΑΛΦΑ", 1032) ' convert from utf16le to ansi 1032, and enpand to utf16LE as locale 1033
print s="alphaBETAÁËÖÁ"
// trait as utfLE16 but for character code from 0 to 255, and return based on locale 1033
print lcase$(s, 1033)="alphabetaáëöá"
// trait as utfLE16 but for character code from 0 to 255, and return based on locale 1032
print lcase$(s, 1032)="alphabetaαλφα"
print lcase$(s1+"ΑΛΦΑ")="alphabetaαλφα"
print str$(s1, ">")="ALPHABETA"
print str$(s1, "<")="alphabeta"
print str$(s1, c)="beta"
}
stringcase
</syntaxhighlight>
{{out}}
<pre>
True
True
True
True
True
True
True
True
True
</pre>


=={{header|M4}}==
=={{header|M4}}==