replace() Replaces old in the current String with new. Syntax String replace(String old, String new) old is the original string. new is the string that replaces old. Related conceptsreplaceAll()replaceFirst()