This will show only the last 4 digits .
private String maskGc(String oS){
int beginIndex=0;
int endIndex=12;
if (oS.length()>15){
oS= oS.replace(oS.substring(beginIndex, endIndex), "****************");
return oS;
}
Output:
****************3456
0 Comments:
Post a Comment