String case: Difference between revisions

→‎{{header|Zig}}: zigstr project has moved; update link in TODO
(Added Chipmunk Basic)
(→‎{{header|Zig}}: zigstr project has moved; update link in TODO)
 
(5 intermediate revisions by 5 users not shown)
Line 1,016:
 
==={{header|Liberty BASIC}}===
{{works with|Just BASIC}}
{{works with|Run BASIC}}
<syntaxhighlight lang="lb">
input$ ="alphaBETA"
Line 1,031 ⟶ 1,033:
lower$ = LCase(s$) ;lowercase</syntaxhighlight>
 
==={{header|QBASICQBasic}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
Line 1,040 ⟶ 1,042:
 
==={{header|Run BASIC}}===
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
<syntaxhighlight lang="runbasic">a$ ="alphaBETA"
Line 1,615 ⟶ 1,619:
OUTPUT (LowerCased);
OUTPUT (TitleCased);</syntaxhighlight>
 
=={{header|Ecstasy}}==
The methods on <code>String</code> are <code>toUppercase()</code> and <code>toLowercase()</code>:
 
<syntaxhighlight lang="ecstasy">
module test {
void run() {
@Inject Console console;
console.print($"{"alphaBETA".toLowercase()=}");
console.print($"{"alphaBETA".toUppercase()=}");
}
}
</syntaxhighlight>
 
{{out}}
<pre>
x$ xec test
"alphaBETA".toLowercase()=alphabeta
"alphaBETA".toUppercase()=ALPHABETA
</pre>
 
=={{header|Elena}}==
Line 2,907 ⟶ 2,931:
Lower case : alphabeta
</pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
##
var s := 'exAmpLe sTrinG';
s.ToLower.Println;
s.ToUpper.Println;
</syntaxhighlight>
{{out}}
<pre>
example string
EXAMPLE STRING
</pre>
 
 
 
=={{header|Peloton}}==
Line 3,774 ⟶ 3,813:
ALPHABETA
ALPHABETA
</pre>
 
=={{header|Uiua}}==
{{works with|Uiua|0.11.1}}
<syntaxhighlight lang="uiua">
¯"alphaBETA" # swapcase
⌵"alphaBETA" # upper
¯⌵"alphaBETA" # lower
±"alphaBETA123" # case mask 1=upper, -1=lower, 0=neither
</syntaxhighlight>
{{out}}
<pre>
"ALPHAbeta"
"ALPHABETA"
"alphabeta"
[¯1 ¯1 ¯1 ¯1 ¯1 1 1 1 1 0 0 0]
</pre>
 
Line 3,909 ⟶ 3,964:
 
The 'Utf8' class recently acquired the first four of the above methods though with considerably wider (albeit still incomplete) Unicode coverage. In particular the upper case variants 'ẞ' and 'Ÿ' are now supported - the former was introduced into official German orthography in 2017 (though is optional) and, of course, now round-trips. Title case for 4 supported digraphs is automatically applied by the ''capitalize'' or ''title'' methods when they are the first character of the string (or, word, in the case of the latter).
<syntaxhighlight lang="ecmascriptwren">import "./str" for Str, Utf8
 
var strs = ["alphaBETA", "ação", "o'hare O'HARE o’hare don't"]
Line 4,113 ⟶ 4,168:
try stdout_wr.print("upper: {s}\n", .{upper});
 
// TODO use https://githubcodeberg.comorg/jecolondude_the_builder/zigstr
}</syntaxhighlight>
 
1

edit