How about something like
words = {} words['word'] = 'newword' words['otherword'] = 'newotherword'
outmessage = message splits = message.split(' ') if (words[splits[0]]) splits[0] = words[splits[0]] outmessage = splits.join(' ') end
obviously it can be cleaned up a fair bit, but the hash will save having a god awful if or switch statement
Simon