Replace the first word of a string

how about this?

lookup = { "word"=>"newword",..} first_word = @message[0...@message.index(" ")] first_word = lookup[first_word]