Select from following answers:- 1234-56**-****-*456-7890
- 1234-5***-****-3456-7890
- 1234-56**-****-3456-7890

- 1234-56**-***-3456-7890
- All Above
The
input.substring(0,7)
will return
1234-56
The
input.substring(7,15)
will return
78-9012- ad then by using the
replace(/\d/g, "*")
we are replacing the digits by *. so the code segment
input.substring(7,15).replace(/\d/g, "*")
will return
**-****- . And then the code segment
input.substring(15)
returns
3456-7890 .Hence the final output will be
1234-56**-****-3456-7890
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator