Here you can use String#replace(char, char) that is much faster than #replaceAll(String, String) that is based on regex.
Same for the other change below.