How to resolve the algorithm String case step by step in the EasyLang programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm String case step by step in the EasyLang programming language
Table of Contents
Problem Statement
Take the string alphaBETA and demonstrate how to convert it to:
Use the default encoding of a string literal or plain ASCII if there is no string literal in your language. Note: In some languages alphabets toLower and toUpper is not reversable. Show any additional case conversion functions (e.g. swapping case, capitalizing the first letter, etc.) that may be included in the library of your language.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm String case step by step in the EasyLang programming language
Source code in the easylang programming language
func$ toUpper s$ .
for c$ in strchars s$
code = strcode c$
if code >= 97 and code <= 122
code -= 32
.
res$ &= strchar code
.
return res$
.
func$ toLower s$ .
for c$ in strchars s$
code = strcode c$
if code >= 65 and code <= 90
code += 32
.
res$ &= strchar code
.
return res$
.
string$ = "alphaBETA"
print string$
print toUpper string$
print toLower string$
You may also check:How to resolve the algorithm Roots of a function step by step in the ooRexx programming language
You may also check:How to resolve the algorithm Burrows–Wheeler transform step by step in the C programming language
You may also check:How to resolve the algorithm String matching step by step in the FutureBasic programming language
You may also check:How to resolve the algorithm Smarandache prime-digital sequence step by step in the Swift programming language
You may also check:How to resolve the algorithm Summarize primes step by step in the Forth programming language