Skip to content

Instantly share code, notes, and snippets.

@digvijaybhakuni
Created March 26, 2018 08:44
Show Gist options
  • Save digvijaybhakuni/8164920554e39fc494ce8f0d490a9c72 to your computer and use it in GitHub Desktop.
Save digvijaybhakuni/8164920554e39fc494ce8f0d490a9c72 to your computer and use it in GitHub Desktop.
Last4DigitMasking
private String getLast4DigitMasking1(String str) {
final char[] chars = str.toCharArray();
for(int i = 0; i < chars.length - 4; i++){
chars[i] = '*';
}
return String.valueOf(chars);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment