Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def swapCase(text)
- x = 0
- length = text.length
- while (x < length)
- if text[x] >= 'a' and text[x] <= 'z' then
- text[x] = text[x].upcase!
- else
- text[x] = text[x].downcase!
- end
- x = x + 1
- end
- return text
- end
Advertisement
Add Comment
Please, Sign In to add comment