Re: Replacing
- Posted by jeremy (admin) Dec 19, 2010
- 1212 views
jimcbrown said...
irv said...
I tried find_replace("%20",fname," "), which doesn't change the filename at all.
match_replace("%20",fname," ")
find_replace, match_replace work just like find and match. Thus
find_replace("%20", "John Doe", "Jim Doe")
is actually looking for {{'%','2','0'}} inside of {'J','o','h','n',...}
Also, these methods do not replace inplace. You must accept the result:
filename = match_replace("%20", filename, " ")
You could use find_replace in a synario such as:
find_replace("Jim", { "John", "Jack", "Joe", "Jim", "Jane" }, "Jeremy")
Jeremy