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 *
*
String text = "Hello World"; System.out.println( text.replaceAll( "[A-Za-z0-9]", "*" ) );
output : ***** *****