Hey guy\'s I tried to find a way to hide a string, but the code that I found just work with my application... Is there a way to hide the characters in a string with either <
public static String maskString(String s, int x) {
int n = s.length()/x;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
if (n >= 1 && (i < n || i >= (s.length() - n))) {
sb.append(s.charAt(i));
}
else {
sb.append("*");
}
}
return sb.toString();
}