waterml/src/main/java/ucar/nc2/ogc/erddap/util/ErddapString2.java
public static String replaceAll(String s, char oldCh, char newCh) {
        int po = s.indexOf(oldCh);
        if (po < 0)
            return s;

        StringBuilder buffer = new StringBuilder(s);
        while (po >= 0) {
            buffer.setCharAt(po, newCh);
            po = s.indexOf(oldCh, po + 1);
        }
        return buffer.toString();
    }
public static String replaceAll(String s, char oldCh, char newCh) {
        int po = s.indexOf(oldCh);
        if (po < 0)
            return s;

        StringBuilder buffer = new StringBuilder(s);
        while (po >= 0) {
            buffer.setCharAt(po, newCh);
            po = s.indexOf(oldCh, po + 1);
        }
        return buffer.toString();
    }
public static String replaceAll ( String s , char oldCh , char newCh ) { int po = s . indexOf ( oldCh ) ; if ( po < 0 ) return s ; StringBuilder buffer = new StringBuilder ( s ) ; while ( po >= 0 ) { buffer . setCharAt ( po , newCh ) ; po = s . indexOf ( oldCh , po + 1 ) ; } return buffer . toString ( ) ; }
Returns a string where all occurences of <TT>oldCh</TT> have
been replaced with <TT>newCh</TT>.
This doesn't throw exceptions if bad values.
Returns a string where all occurences of <TT > oldCh< / TT > have been replaced with <TT > newCh< / TT > . This doesn t throw exceptions if bad values .