From: Bigmac Turdsplash Date: 2009-09-10T14:16:53+09:00 Subject: Re: string.each 7stud -- wrote: > Bigmac Turdsplash wrote: >> after i split the string, how can i put the string back into its >> original form? > > str = ["hello", "my", "name", "is", "bigmac"].join(" ") > puts str > > --output:-- > hello my name is bigmac lets say im reading a string from a socket and its super long, i want to trim the first word from the string then do something with the rest of the string... str = "disaster a bunch of junk. 98rh98rh98ujvi".split puts str[1] # idetify the first word, puts str[2 threw X].join(" ") # takes the rest of the string and prints to screen in its original form... but how do i know what X is? (until end of string) -- Posted via http://www.ruby-forum.com/.