Challenge 45

🔠🔡

Case Converter

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

The Cambridge A-Level pseudocode specification contains the functions TO_LOWER and TO_UPPER respectively to convert a string's case

For IGCSE/O-Level, these functions are LCASE and UCASE

Your job is to recreate the functionality of these, as if you were the person implementing them for the first time

You are not allowed to use the following functions, but everything else is permitted:

Note: while it is possible to solve if doing IGCSE/O-Level, A-Level provides some additional functions which makes this far easier

Examples:

MY_LOWER("aBcDE") would return "abcde"

MY_UPPER("aBcDE") would return "ABCDE"

MY_LOWER("aBcDE #123! XyZ") would return "abcde #123! xyz"

Solutions

A-Level 9618