Text&Variables... Help?

Ok, Im making this simple thing that asks you questions, and you put a Y for Yes, and a N for No. So how would I write this?

if(cmd == "Y"){
    log = "Next question..."
}

like that?