Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Masking a String with only last 2 digits displayed

User_19BPUJul 5 2011 — edited Jul 8 2011
Hi,

I will get a list of account numbers from the DB which I need to mask it with "$" except the last 2 characters. It will be numeric
and the size is 15 in DB. Like for example , i may get the account numbers which are of 10 character width as well as 15 character width but still i need to parse
the account number and display only the last 2 numbers in it with other numbers masked with "$".

Like $$$$$$$$$$$$$54 for 15 digit account number. The above needs to be done with in a loop as there a list of account numbers which
will be retreived from the DB. Which is the best possible way to do this?

Thanks,
CrazyJavaLover
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2011
Added on Jul 5 2011
20 comments
4,596 views