code: public static String Replace(String aSrcStr, String aSearchStr, String aReplaceStr) {
          if (aSrcStr == null || aSearchStr == null || aReplaceStr == null)
              return aSrcStr;
  
          if (aSearchStr.length() == 0
              || aSrcStr.length() == 0
              || aSrcStr.indexOf(aSearchStr) == -1) {
              return aSrcStr;
          }
  
          StringBuffer mBuff = new StringBuffer();
          int mSrcStrLen, mSearchStrLen;
  
          mSrcStrLen = aSrcStr.length();
          mSearchStrLen = aSearchStr.length();
          for (int i = 0, j = 0; i < mSrcStrLen; i = j + mSearchStrLen) {
              j = aSrcStr.indexOf(aSearchStr, i);
              if (j == -1) {
                  mBuff.append(aSrcStr.substring(i));
                  break;
              }
              mBuff.append(aSrcStr.substring(i, j));
              mBuff.append(aReplaceStr);
          }
          return mBuff.toString();
      }
docs: Replaces the 'search string' with 'replace string' in a given 'source string'
  
  @param aSrcStr A source String value.
  @param aSearchStr A String value to be searched for in the source String.
  @param aReplaceStr A String value that replaces the search String.
  
  @return A String with the 'search string' replaced by 'replace string'.