I want to replace all the characters in a Java String with * character. So it shouldn\'t matter what character it is, it should be replaced with a *
*
How abt creating a new string with the number of * = number of last string char?
StringBuffer bf = new StringBuffer(); for (int i = 0; i < source.length(); i++ ) { bf.append('*'); }