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?
×_×
help please
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Misiu
16 October 2020, 22:15
%d - integer value get from the second argument (data.getPhoneNumber()).replaceFirst(".......",".......")
010 - ten places, leading zeros
Example:
String.format("%010d", 123);
Result:
0000000123
https://mkyong.com/java/java-string-format-examples/
0
sourav bamotra
16 October 2020, 22:48
oh! tysm misiu :)
0