What a good way to do this? It looks like I could use a combination of several different methods to achieve what I want, but there is probably a simpler method that I skip. For example, the PHP function preg_replace will do this. Anything like that in Ruby?
simple example of what I plan to do:
orig_string = "all dogs go to heaven" string_to_insert = "nice " regex = /dogs/ end_result = "all nice dogs go to heaven"
source share