From: Xan Xann Date: 2006-09-07T07:36:23+09:00 Subject: word substitution in file Hi, Can anyone help me in that? I just want to write the following function: substitute(f,g,w,x) where f and g are files and w and x are strings That function substitutes all the ocurrences of w in the file f and writes x to g For example, if f is: " Hello folks or old men " and w = "ol" and x="ur" then g is: " Hello furks or urd men " Can anyone show me some code? I thinked to pass file to string but I thinked it was not very fast. Better directly -- Posted via http://www.ruby-forum.com/.