From: samuel.murphy@...
Date: 2006-02-13T02:18:27+09:00
Subject: Re: Cutting a piece of text
Learn regular expressions. Here's a not great example:
a = " Lalalalala "
b = a.gsub(/\w*=\w*/ , "")
c = b.gsub(/\s/, "")
print c, "\n"
Lalalalala
A slightly (yes very slightly) more realistic example:
a = '
Lalalalala '
b = a.gsub(/\w*="\w*"/ , "")
c = b.gsub(/\s/, "")
print c, "\n"
Lalalalala
And what if there are spaces in a tag:
a = '
Lalalalala '
b = a.gsub(/\w*=".*"/ , "")
c = b.gsub(/\s/, "")