Guest User

Untitled

a guest
Feb 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. class String
  2. def change_case
  3. self.gsub(/([A-Z]*)([a-z]*)/){"#{$1}".downcase + "#{$2}".upcase}
  4. end
  5. end
  6.  
  7. "UPUPdowndownLeftrIGHTlEFTrightBABAstart".change_case
Add Comment
Please, Sign In to add comment