From: John W Higgins Date: 2010-07-14T07:24:25+09:00 Subject: Re: What does this do? --00163628455474bf4e048b4c5411 Content-Type: text/plain; charset=ISO-8859-1 Afternoon, > For example, this from the documentation: > a = "hello there" > a[-3,2] #=> "er" > > -3 ---> Start counting from 0 to 3 from the end (Right -> Left) > In this case I reached the letter "h" of there > > 2 ---> What should I do here? > > Thanks. > > At some point you have to at least make some attempt to understand something here. IRB is again your friend here. While I get that you are learning this - you cannot just sit there like a lump on a log and expect things to be given to you over and over again. Would you please at least try some variants of things to see if you are correct. For example, if a[-3,2] returns a string of 2 characters what maybe does the 2 mean? How about trying [-3,3] and seeing how many characters you get back. That might be a great way to validate the obvious answer as to what the 2 means. Now as to the -3 maybe you aren't counting correctly - so how about trying this a = "987654321" a[-1, 1] a[-2, 2] a[ -3, 3] And see what you get. The answers are very self obvious - but you really have to put in at least some effort here....... Reading a book and never even attempting any concepts just won't work! John --00163628455474bf4e048b4c5411--