From: David Masover Date: 2010-10-18T00:42:52+09:00 Subject: Re: What's the opposite of << On Saturday, October 16, 2010 06:00:39 pm Paul Roche wrote: > But on a simple level...... > > > say in irb mode I did the following... > > > name = "John" > > name << " Smith" > > => John Smith > > > > Would it be possible to take "John" or "Smith" from name? Not really, now that we know it's Strings. If it was Arrays, for instance: name = [] name << 'John' name << 'Smith' name.first # John name.last # Smith But since it's strings... Let me put it this way: name = "John Smith" That's basically what you just did. Now, if you assume there's a space in there, you can do this: name.split ...that will produce an array by splitting the string by whitespace. But that has nothing to do with the concatenation -- for example, if you do this: name = 'John' name << 'Smith' Now name is 'JohnSmith', which means you'd need to look for some other way to tell them apart. Josh Cheek's method certainly works if you still have lastname lying around...