看了看ruby的String类的例子,不得不感叹 确实比java的String对象操作灵活
=begin
str1 = 'this is str1'
str2 = "this is str2"
str3 = %q/this is str3/
str4 = %Q/this is str4/
str5 = <<OK_str
Here
OK_str
puts str3
puts str4
puts str5
=end
str = 'this' + 'is'
str += 'you'
str << "string"<<"."
puts str*2
puts str[-12,12]