Quoting Pale Horse <[email protected]>:
> Example A: "Example One"
> 
> What I need is a string method to remove " One" from that string so the
> result is just "Example".
>

 irb(main):010:0> "Example One and trailing stufff".split(' ', 2)[0]
=> "Example"

irb(main):014:0> "Example One and trailing stuff".slice(/\w+/)
=> "Example"

HTH,
  Jeffrey
-- 
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