From: dare ruby Date: 2008-05-20T13:30:35+09:00 Subject: Re: How is this split method working? Pe単a, Botp wrote: > From: Raj Singh [mailto:neeraj.jsr@gmail.com] > # length = 20 > # text = ' This forum is connected to a mailing list that is read by > # thousands of people.' > # text.split[0..length] > # I looked at the split api but can't understand how the above code is > # working. > > Hi Raj, > > u didn't show what you wanted. > > so (i guess :), maybe you want string#[] or string#slice instead, > > length=20 > #=> 20 > > text = ' This forum is connected to a mailing list that is read by > thousands of people' > #=> " This forum is connected to a mailing list that is read by > thousands of people" > > text[0,length] > #=> " This forum is conne" > > text[0..length-1] > #=> " This forum is conne" > > text[length..-1] > #=> "cted to a mailing list that is read by thousands of people" > > kind regards -botp yes i agree with your comments. raj you did not specified what you need clearly but hope the above would help you a lot in your work. this is the thing you expected? ready to do it for you but need specifications clearly. -- jose martin -- Posted via http://www.ruby-forum.com/.