From: George Date: 2007-11-27T14:07:39+09:00 Subject: Re: specify start postion of Regexp matching On Nov 26, 2007 5:07 PM, 7stud -- wrote: > Jordan Callicoat wrote: > > You have to create a sub-string with > > the 1.8 version, but according to Robert Klemme (above) it's just > > creating a pointer into the original string if you're not changing the > > substring or original string. > > I'm having a hard time confirming that: > > str = "hello" > sub_str = str[1, 2] > > puts str.object_id > -->76750 > > puts sub_str.object_id > -->76740 > > puts sub_str.class > -->String A new ruby object is created, but the string buffer that it points to is only copied on write.