Question: Help parsing strings in java, regex can be used. Mask all the digits in a phone number except the last 4 dligits. Each number should
Help parsing strings in java, regex can be used.

Mask all the digits in a phone number except the last 4 dligits. Each number should be replaced by stan")Input Phone numbers can be with or without country code. Input Phone numbers can only haveorin them along with numbers and spaces. Make sure- is not masked in the output and make sure the number of stars is equal to the number of digits while masking. Phone numbers will always have 10 digits without country code and with country code they could be up to 13 digits. Example 1: +1 (333) 444-5678-> -'.a_6A,-5678 Example1:+91 (333)141-561 --56B Example! : +1 1 1 (333) 444-5678 -.> s_em.xxx-5678 Example2: 333 444 557a -x-5676 Example: (333) 444-56785678
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
