java - How to apply a mask to a String? -


hi have credit card number string. need apply mask hide cc number:

i have "123-123-123" , need "123-xxx-123"

is there elegant way this? i'm trying avoid using severals substring() functions...

thanks in advance

myccstr = myccstr.replacefirst("-[0-9]{3}-", "-xxx-");


Comments

Popular posts from this blog

c# - IMAP GMAIL getting folder list problem -

PHP proxy to get XML: problem with URL arguments -