Difference between revisions of "RemoveHTMLTags"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
|p1_type=string|p1_name=input_string|p1_desc=String to remove HTML tags from | |p1_type=string|p1_name=input_string|p1_desc=String to remove HTML tags from | ||
|return_type=string | |return_type=string | ||
|return_text= | |return_text=with HTML ( or XML ) tags and newline characters removed. | ||
|func_footnote= | |func_footnote= | ||
See also: [[String]] | See also: [[String]] |
Revision as of 06:17, 5 July 2010
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>