How to compare 2 strings

then whenever the reply is completely typed by user and presses on send button, then we can compare and based on that result can be given know