Try to_str and if that doesn't work try to_s (supported by almost all
classes)

--Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of beth ferguson
Sent: Tuesday, October 11, 2005 10:23 AM
To: Watir Mailing List
Subject: [Wtr-general] string split after ie.contains_text

theText= $~ = $ie.contains_text(/Event\#
([0-9]+)([0-9]+)([0-9]+)([0-9])/)

puts (theText);

b = theText.split(/\d/)

b.push(theText.sub(b[0],""))

puts b

The above snippet does not work if theText is gotten via the 
contains_text method. (I get the following error:

./createEvent.rb:40:in `userCreateEvent': private method `split' called 
for #<MatchData:0x304f3f0> (NoMethodError) from someTest.rb:88)

However the snippet does work if I hand it the string ("Event# 1234"). 
Is there a ToString() method or something like that , that I can use to 
make theText into a flat string rather than a method referent.

Thanks-

Beth

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to