/**
     * 字符串替换,将 source 中的 oldString 全部换成 newString
     *
     * @param source 源字符串
     * @param oldString 老的字符串
     * @param newString 新的字符串
     * @return 替换后的字符串
     */
    public String replace(String source, String oldString, String newString) {
     if(source == null || oldString==null || newString == null) return null;
        StringBuffer output = new StringBuffer();        int lengthOfSource = source.length();   // 源字符串长度
        int lengthOfOld = oldString.length();   // 老字符串长度        int posStart = 0;   // 开始搜索位置
        int pos;            // 搜索到老字符串的位置        while ((pos = source.indexOf(oldString, posStart)) >= 0) {
            output.append(source.substring(posStart, pos));            output.append(newString);
            posStart = pos + lengthOfOld;
        }        if (posStart < lengthOfSource) {
            output.append(source.substring(posStart));
        }        return output.toString();
    }