You probably already know that Gitter let's you edit your messages within 10 minutes of sending by pressing
↑ in the input area, or clicking the edit icon on the message.
Another, more developer-friendly method also exists. Just type
s/string/replacement/ in the input area to replace the first occurrence in your last message, or
s/string/replacement/g to replace all occurrences.