Re: Replacing

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu