I'm new to swift and studying functions rn. I have a task that's given in the title, and I can't really imagine how to do it. I need to make a func that turn all the vowel letters into lowercase, all consonants into uppercase and write numbers in letters
what I expect it to look like:
- original: "hello, I have been studying swift for 1 month"
- the result: "hEllO, I hAvE bEEn stUdUIng swIft fOr OnE mOnth"
the func should accept a string and return a string
I tried doing it with tuples, I had one tuple of arrays for each condition, for example:
var lowercase: [Character] = ["a", "e", "i", "o", "e", "y"]
uppercase: [Character] = ["A", "E", "I", "O", "E", "Y"]
and also a dictionary to turn numbers into words: let nums = [1:"one", 2:"two", 3:"three", 4:"fourth", 5:"five"]
but I still can't make it work, don't know how to change arrays' elements inside the func