标签:style blog color ar java strong sp div on
summary:
1: puts "s in #{user_input}" 和puts ‘s in #{user_input}‘不同,前者#{user_input}会输出user_input的值,后者只是输出鸳原样,s in #{user_input}
1 print "Thtring, pleathe!: " 2 user_input = gets.chomp 3 user_input.downcase! 4 5 if user_input.include? "s" 6 user_input.gsub!(/s/, "th") 7 else 8 puts "Nothing to do here!" 9 end 10 11 puts "Your string is: #{user_input}"
(As a general rule, Ruby methods that end with ?
evaluate to the boolean values true
or false
.
标签:style blog color ar java strong sp div on
原文地址:http://www.cnblogs.com/jypwn/p/4044262.html