String case: Difference between revisions

m
(add task to aarch64 assembly raspberry pi 3)
Line 1,550:
EasyLang does not have string case functions. The functions provided below only work with ASCII.
<syntaxhighlight lang="easylang">
func$ toUpper s$ .
proc toUppercase string$ . result$ .
for ic$ =in 1strchars to len strings$
code = strcode substr stringc$ i 1
if code >= 97 and code <= 122
code -= 32
.
resultres$ &= strchar code
.
return res$
.
func$ toLower s$ .
proc toLowercase string$ . result$ .
for ic$ =in 1strchars to len strings$
code = strcode substr stringc$ i 1
if code >= 65 and code <= 90
code += 32
.
resultres$ &= strchar code
.
return res$
.
string$ = "alphaBETA"
print string$
callprint toUppercasetoUpper string$ result$
print resulttoLower string$
result$ = ""
call toLowercase string$ result$
print result$
</syntaxhighlight>
{{out}}
1,978

edits