Android Utililty Methods String Mask

List of utility methods to do String Mask

Description

The list of methods to do String Mask are organized into topic(s).

Method

StringmaskLeft(String s, int len, char maskChar)
Returns a string consisting of "s", with each of the first "len" characters replaced by "maskChar" character.
if (len <= 0) {
    return s;
len = Math.min(len, s.length());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; i++) {
    sb.append(maskChar);
sb.append(s.substring(len));
return sb.toString();