goja-web/src/main/java/goja/mvc/csv/CsvUtil.java
public static String replace(String original, String pattern, String replace) {
        final int len = pattern.length();
        int found = original.indexOf(pattern);
        if (found > -1) {
            StringBuilder sb = new StringBuilder();
            int start = 0;
            while (found != -1) {
                sb.append(original.substring(start, found));
                sb.append(replace);
                start = found + len;
                found = original.indexOf(pattern, start);
            }
            sb.append(original.substring(start));
            return sb.toString();
        } else {
            return original;
        }
    }
public static String replace(String original, String pattern, String replace) {
        final int len = pattern.length();
        int found = original.indexOf(pattern);
        if (found > -1) {
            StringBuilder sb = new StringBuilder();
            int start = 0;
            while (found != -1) {
                sb.append(original.substring(start, found));
                sb.append(replace);
                start = found + len;
                found = original.indexOf(pattern, start);
            }
            sb.append(original.substring(start));
            return sb.toString();
        } else {
            return original;
        }
    }
public static String replace ( String original , String pattern , String replace ) { final int len = pattern . length ( ) ; int found = original . indexOf ( pattern ) ; if ( found > - 1 ) { StringBuilder sb = new StringBuilder ( ) ; int start = 0 ; while ( found != - 1 ) { sb . append ( original . substring ( start , found ) ) ; sb . append ( replace ) ; start = found + len ; found = original . indexOf ( pattern , start ) ; } sb . append ( original . substring ( start ) ) ; return sb . toString ( ) ; } else { return original ; } }
特殊字符的转换 "\t" -> "\\t"
特殊字符的转换 \ t - > \\ t