From: Cliff Rosson Date: 2013-03-13T05:44:31+09:00 Subject: Re: Confusion with Strings --20cf303b42e11e494304d7c05b81 Content-Type: text/plain; charset=ISO-8859-1 Language problems here. Not worth getting worked up over imho. On Tue, Mar 12, 2013 at 1:40 PM, Love U Ruby wrote: > @Scott. > > yes I do here it ia: > > >> s = "hello" > => "hello" > >> s["e"] = "u" > => "u" > >> s > => "hullo" > > The answer to the line **a too-high or too-low numerical index ** > > >> str = 'aaa' > => "aaa" > >> str[-4] = "x" > IndexError: index -4 out of string > from (irb):57:in `[]=' > from (irb):57 > from C:/Ruby193/bin/irb:12:in `
' > >> str[-5] = "x" > IndexError: index -5 out of string > from (irb):58:in `[]=' > from (irb):58 > from C:/Ruby193/bin/irb:12:in `
' > >> str[4] = "x" > IndexError: index 4 out of string > from (irb):59:in `[]=' > from (irb):59 > from C:/Ruby193/bin/irb:12:in `
' > > Actually that word `too big` and `too small` made me to think too much.. > lollzzzzzzz. > > Guys if my understanding with the line is wrong then please correct me. > > -- > Posted via http://www.ruby-forum.com/. > > -- vizualize.me/cliffrosson --20cf303b42e11e494304d7c05b81 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Language problems here. Not worth getting worked up over i= mho.


On = Tue, Mar 12, 2013 at 1:40 PM, Love U Ruby <lists@ruby-forum.com>= wrote:
@Scott.

yes I do here it ia:

>> =A0s =3D "hello"
=3D> "hello"
>> s["e"] =3D "u"
=3D> "u"
>> s
=3D> "hullo"

The answer to the line **a too-high or too-low numerical index **

>> str =3D 'aaa'
=3D> "aaa"
>> str[-4] =3D "x"
IndexError: index -4 out of string
=A0 =A0 =A0 =A0 from (irb):57:in `[]=3D'
=A0 =A0 =A0 =A0 from (irb):57
=A0 =A0 =A0 =A0 from C:/Ruby193/bin/irb:12:in `<main>'
>> str[-5] =3D "x"
IndexError: index -5 out of string
=A0 =A0 =A0 =A0 from (irb):58:in `[]=3D'
=A0 =A0 =A0 =A0 from (irb):58
=A0 =A0 =A0 =A0 from C:/Ruby193/bin/irb:12:in `<main>'
>> str[4] =3D "x"
IndexError: index 4 out of string
=A0 =A0 =A0 =A0 from (irb):59:in `[]=3D'
=A0 =A0 =A0 =A0 from (irb):59
=A0 =A0 =A0 =A0 from C:/Ruby193/bin/irb:12:in `<main>'

Actually that word `too big` and `too small` made me to think too much.. lollzzzzzzz.

Guys if my understanding with the line is wrong then please correct me.



--
=
--20cf303b42e11e494304d7c05b81--