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 *
*
public String allStar(String s) { StringBuilder sb = new StringBuilder(s.length()); for (int i = 0; i < s.length(); i++) { sb.append('*'); } return sb.toString(); }