If your friend sent you that malicious string of text to see if it really crashes your phone, you have a problem (and a really lousy friend).
You won’t even know if your idiot friend has sent it to you, because your iPhone will reboot instantly.
Don’t panic, your iPhone is not under deadly attack. There are recovery methods as discovered and shared by other users, or rather victims.
You can have your idiot friend send another message immediately to cancel out the previous one.
But since chances are that he’ll be too busy smirking at his handiwork to give a crap, you can take matters into your own hands and pull up Siri and tell her to “Send a message to myself”, open Notes or any other app with a Share function to message something, anything to yourself. The point is to get back into the Message app by texting yourself, and all should be fine and dandy.