Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cap_last_three string; string[0..-4] << string[-3..-1].upcase; end
- puts "Enter your word to be upcased."
- word = STDIN.gets.chomp
- if word.length < 4 then
- puts "upcased: #{word.upcase}"
- puts "Thanks for upcasing some stuff = William Woodrm"
- else
- print word.cap_last_three
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement