removeHTMLTags
Revision as of 05:17, 5 July 2010 by Alexander Howe (talk | contribs)
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: string RemoveHTMLTags( string input_string );Returns a string with HTML ( or XML ) tags and newline characters removed.
• string | input_string | – | String to remove HTML tags from |
See also: String
Specification
<lsl> string RemoveHTMLTags(string src) {
integer is_HTML = 0; string result = ""; string s; integer i; for (i=0; i<llStringLength(src); i++) { s = llGetSubString(src,i,i); if (s == "<") { is_HTML = 1; } if (is_HTML == 0 && s != "\n") { result += s; } if (s == ">") { is_HTML = 0; } } return result;
} </lsl>
Caveats
none
Examples
<lsl> src = RemoveHTMLTags(src);
</lsl>