int pos2 = empAcc.indexOf ('\\');//yes there is an accountif (pos2 != -1){ domain = empAcc.substring(0,pos2); account = empAcc.substring(pos2+1); account = account.trim(); account = account.toLowerCase();}else{domain = empAcc;}