Control Led with Gsm shield

i need to set a string variable ,for example string smstext ; and a part of code like this :

if (smstext == "H")
    {
      digitalWrite(13,HIGH);
    }
    else if (smstext == "L")
    {
      digitalWrite(13,LOW);
    }

am i right ?? where i have to attach this part to the previous code ??