From: Adam Salter Date: 2009-09-11T16:08:02+09:00 Subject: Re: string.each --Apple-Mail-3--539667840 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Did not know that. ... and I already thought ruby was awesome... -Adam On 10/09/2009, at 3:47 PM, 7stud -- wrote: > But instead of splitting a super long string and then re-joining it, > you > can just split off the first word like this: > > str = "a really long string" > > first_word, the_rest = str.split(" ", 2) > > p first_word > p the_rest > > --output:-- > "a" > "really long string" --Apple-Mail-3--539667840--