There's a replace method in java.lang.String.