1. I'm trying to write a function that will do a find-and-replace on the entry text. It would search the entry for foo and replace every instance of foo with bar. Is this even possible
( Read more... )
You can do a search and replace, but you can't use regexes or wildcards. (Although I think I saw someone making an attempt at that too, so maybe it is possible. I just don't remember where the entry was, most likely s2styles.)
function replace_text(string text, string find, string replacement) : string "Search within \$text and replaces any occurences of \$find with \$replacement
( ... )
Comments 2
Anyway, I use a function created by mageboltrat:
function replace_text(string text, string find, string replacement) : string "Search within \$text and replaces any occurences of \$find with \$replacement ( ... )
Reply
Reply
Leave a comment