Pale Horse wrote:
>> a = "Example One"
>> a = a.split(/ /)[0]
>> 
>> In general, the way to solve a problem is to try and tackle it from 
>> different angles.
>> Do you want to ...
>> a) remove everything after 'Example'?
>> b) remove the last four characters of the string?
>> c) remove everything after the first word?
>> d) remove the last word and the last space?
> 
> I want to remove everything after the first word.

Well, then my solution works for you, but you should familiarize 
yourself with it.
http://ruby-doc.org/core/

Go check out the String methods.
-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to