made 16 attempts to solve. but finally i go through that weird pattern of String.format("%010d",data.getPhoneNumber()).replaceFirst("................","......................"); Any referral to online text to understand such pattern? ×_×