String str = mobile; partical_mobile = str.substring(0, str.length() - (str.substring(3)).length()) + "****" + str.substring(7);