Serial object cannot recognize last character of input serial stream

Set your Serial Monitor to no line endings and try again. That last character is most likely your CR (0x0C). The String class also has a .trim() function that will remove any/all line endings