code: static public String replaceString(String str, String strReplace,
  			String strWith) {
  		StringBuffer sb = new StringBuffer();
  		int iCurrent = 0;
  		int iFound;
  		int iReplaceLen = strReplace.length();
  
  		if (str == null || strReplace == null || strWith == null)
  			return str;
  		if (str.equals("") || strReplace.equals(""))
  			return str;
  
  		while (true) {
  			iFound = str.indexOf(strReplace, iCurrent);
  			if (iFound == -1) {
  				sb.append(str.substring(iCurrent));
  				break;
  			}
  
  			if (iFound != iCurrent)
  				sb.append(str.substring(iCurrent, iFound));
  			sb.append(strWith);
  			iCurrent = iFound + iReplaceLen;
  		}
  
  		return sb.toString();
  	}
docs: 字符串替换
  
  @param str
  String
  @param strReplace
  String
  @param strWith
  @return String