Hey, can I restrict a sertain string within a textfield?

if(textfield.text == *"****"*)
{
}

type of thing?....