Capitalize the result with the capitalize method, if you want : capitalize « String « Ruby






Capitalize the result with the capitalize method, if you want


line = "A horse! a horse! my kingdom for a horse!"

line[18, 23].capitalize # => "My kingdom for a horse!"

 








Related examples in the same category

1.Call capitalize function from string class
2.Add two method to string class to capitalize first letter