How do I get a string from the com port and check it?

Another serial overview:
Arduino Tutorial - Lesson 4 - Serial communication and playing with data (ladyada.net)

With the Arduino standard core, one typically acquire serial data one-character-at-a-time.

Characters can be assembled into Strings or strings.
Some of my old stuff:

Don't Cross The Streams (FP scientific calculator serial co-processor) - Community / Exhibition / Gallery - Arduino Forum

The QBF - "The Quick Brown Fox..." For Serial Diags - Community / Exhibition / Gallery - Arduino Forum