View/Edit #52:detag

Switch to edit mode.

Name(s): detag
1:  "Return the input string, but with all HTML tags removed."
2:  if (typeof(args[1]) == $LIST)
3:    text = {}
4:    for line in (args[1])
5:      text = {@text, this:(verb)(line)}
6:    endfor
7:    return text
8:  endif
9:  if (!index(args[1], "<"))
10:   return args[1]
11: endif
12: text = args[1]
13: while (x = index(text, "<"))
14:   y = index(text[x..$], ">")
15:   text[x..y ? x + y - 1 | length(text)] = ""
16: endwhile
17: return text
18: "Last modified by Dax (#789) on Tue May  3 13:45:02 2005 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Hacker (#60)

You are not logged in.

[home | help | who | search | setup | code]