Reputation: 4599
I have EditText
to enter credit card number. I just want to secure first 12 digits and last 4 digits as normal. There should be spaces in between as well. Like the image below:
And card numbers should be extractable from the EditText
ie, if editText.getText()
should return the whole card number. Please help on this.
Upvotes: 1
Views: 2440
Reputation: 2280
You could try something like that:
String text = editText.getText();
String star = "**** **** **** " + text.subString(text.length() - 4);
Upvotes: 2