Devin Mullins
7/6/2005 4:08:00 AM
tuyet.ctn@mscibarra.com wrote:
>How do I extract "treeframe1120266500902" from this String class
>and stored it in a variable to be used later?
>
>
(Almost) Everything in Ruby is an Object, so what you're asking for is
another String object. "treeframe112..." is just a human-readable
representation of that object, and a variable is just a pointer to that
object.
Like Assaph said, you can use regexes to get such a String. ri
String#match or String#scan or StringScanner, for instance.
If you plan on parsing a lot of HTML, there are some Ruby HTML parsers.
Michael Neumann's Mechanize has been recommended on this list before,
but that's as much as I know about it.
Devin