API FindAndReplaceTags

From Vendetta Lua
Revision as of 21:58, 25 January 2009 by Chefkoch (Talk | contribs) (split)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

FindAndReplaceTags

Definition:
FindAndReplaceTags(string text, table matches) -> string ret1
Description:
Replaces all occurances of with < and > enclosed substrings in text with matching values from the provided table
Arguments:
test string to replace tags in
matches table with tags/replacement pairs
Returns:
ret1: converted text
Example:

FindAndReplaceTags("hi this is a<br>linebreak", {br="\n"})<br>
-> "hi this is a
linebreak"