String indexing/setting

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")

s = "000011481^3"

s[2..pos] = "BigString"

puts s

On one server I have 1.82 and it generates "00BigString1481^3" on another
with 1.84-20 it generates "00BigString". However, on a third server I have
a 1.84 version that puts out a similar version as the 1.82.

These are all Windows machines.

What should I be expecting?

Thanks!

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

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