Newbie: text replacement in my case
问题 In my Ruby on Rails app, I have a method in my helper which opened a file by: content = File.open(myfile.txt) The content of the file is like: my.car , my.seat, my.age; my.son , my.dog, my.chair; ... So, I split the content by " ; " like following: content.split(';').each do |line| #Here, I want to replace the text from "my" to "her" on each line end How to replace each line's "my" to "her" in the content? that's to update content to: her.car , her.seat, her.age; her.son , her.dog, her.chair;