Does anybody have a good starting point for how to read the first word
of a string and then, based on several defined pairs, swap it?

I've been considering using something like

@split = @message.split('-')
if @split[0] == "word"
...
elsif @split[0] == "otherword"
...
end

Even if this is the best way to do it, I'm not sure how to replace the
word or patch the string back up for display. :/
-- 
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