Advertisement
Guest User

Untitled

a guest
Sep 25th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def cap_last_three string; string[0..-4] << string[-3..-1].upcase; end
  2.  
  3. puts "Enter your word to be upcased."
  4. word = STDIN.gets.chomp
  5.  
  6. if word.length < 4 then
  7. puts "upcased: #{word.upcase}"
  8. puts "Thanks for upcasing some stuff = William Woodrm"
  9. else
  10. print word.cap_last_three
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement