The replace method replaces a string wholesale. : replace « String « Ruby






The replace method replaces a string wholesale.


call = "All hands on deck!"
puts call.replace "All feet on deck!"

 

Related examples in the same category

1.Replace a substring
2.Use ERB to replace string