alternate case - a string processing function that returns a string argument with each letter alternated.
acase(string)
acase works with variable-, fixed-length and constant strings. The result can be assigned to a variable or fixed-length string, and passed to a string parameter or function result. If the specified string is in lowercase then acase has the same effect as ucase. If the specified string is in uppercase then acase has the same effect as lcase.
This example converts a string to alternate case, then to lowercase and finally to uppercase using acase.
' SharpBASIC acase programming example
' ------------------------------------
incl "lib/sys.sbi";
dim s: str = "heLLo wOrlD!";
main do
print(s);
' alternate case
s = acase(s);
print(s);
' lowercase
s = lcase(s);
print(s);
' alternating lowercase to uppercase
s = acase(s);
print(s);
end
Output:
heLLo wOrlD!
HEllO WoRLd!
hello world!
HELLO WORLD!