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 <
Just create a string with the same number of characters as your original, with instead your "obfuscating" character.
String x = "ABCD";
String output = "";
for (int i = 0; i < x.length(); i++) {
output += "*";
}
Alternatively you could use x.replaceAll("\\S", "*"), which would preserve whitespace as well.