Steven Ketcham
9/29/2006 9:11:00 PM
Sorry! Wrong order in the copy-and-paste.
s = "000011481^3"
pos = s.index("11")
s[2..pos] = "BigString"
puts s
Thanks!
Steve
-----Original Message-----
From: Simon Kröger [mailto:SimonKroeger@gmx.de]
Sent: Friday, September 29, 2006 5:06 PM
To: ruby-talk ML
Subject: Re: string indexing/setting
Steven Ketcham wrote:
> I think I found a version difference between 1.82 and 1.84-20 Stable and I
> wanted to know what correct code was and what was not.
>
> pos = s.index("11")
what is 's' here?
> s = "000011481^3"
>
> s[2..pos] = "BigString"
>
> puts s
cheers
Simon