puoi mettere un controllo di questo tipo


if(stringa.indexOf("/")>-1)NON ESEGUIRE IL CONTROLLO