I moved the to_s and strip before the format and that worked.

I'll take it.



-----Original Message-----
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On 
Behalf Of Moochie
Sent: Wednesday, February 25, 2009 8:28 AM
To: Watir General
Subject: [wtr-general] Re: Issue converting strings

Still cannot figure this one out.

On Feb 20, 1:39 pm, Moochie <dduph...@redbrickhealth.com> wrote:
> I'm writing code to be able to mask out a portion of the strings.
> excel_value = testops on 02/19/2009*
> if excel_value.index("*") != nill  #Equals 21
>   puts excel_value
>   puts excel_value[0,excel_value.index("*").to_i].to_s.strip
>   puts label_id.document.lastChild.nodeValue.to_s.strip
>   puts label_id.document.lastChild.nodeValue[0,excel_value.index
> ("*").to_i].to_s.strip
> end
> results
> testops on 02/19/2009*
> testops on 02/19/2009
> testops on 02/19/2009 10:44
> testops on 02/19/200
> Question why did the last statement not display the 9?

You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to