String phoneNo= "12344446666"; String newPhoneNo= phoneNo.substring(0,3)+"****"+phoneNo.substring(7,phoneNo.length());