Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

oneline:strip_tags

0 views
Skip to first unread message

Haoqi Haoqi

unread,
Nov 20, 2009, 9:34:14 AM11/20/09
to
text=strip_tags(html)

can you just using oneline ruby code define the strip_tags methods?
def strip_tags(html)
//oneline here
end
--
Posted via http://www.ruby-forum.com/.

Fleck Jean-Julien

unread,
Nov 20, 2009, 9:57:53 AM11/20/09
to
2009/11/20 Haoqi Haoqi <ax...@126.com>:

> text=strip_tags(html)
>
> can you just using oneline ruby code define the strip_tags methods?

Would that be good enough ?

def strip_tags(html)
return html.gsub(/<.*?>/)
end

Cheers,

--
JJ Fleck
PCSI1 Lycée Kléber

0 new messages