Mega Code Archive

 
Categories / Ruby / String
 

Call the to_s method on many built-in classes to return the contents of the object as a string

puts 1000.to_s puts [1,2,3].to_s puts ({ :name => 'Fred', :age => 10 }).to_s