From: "何平" Date: 2011-02-20T12:27:33+09:00 Subject: Re: Possible combination trick if you are talking about replacing in strings, most text editors have search/replace functions to. want to do it in ruby? take a look at String.gsub -------------------------------------------------- From: "Adam Abc" Sent: Sunday, February 20, 2011 10:52 AM Newsgroups: comp.lang.ruby To: "ruby-talk ML" Subject: Possible combination trick > Let's say I have this: > > to you the dog > to that the dog > was to the dog > and you the dog > you and the dog > and that the dog > and he the dog > he and the dog > and was the dog > > and I want this > > to you and this > to that and this > was to and this > and you and this > you and and this > and that and this > and he and this > he and and this > and was and this > > How do you change every the dog to and this? Then have it sent to a .rb > file. > > -- > Posted via http://www.ruby-forum.com/. > >