code: public static String doubleChar(final String str, final char c)
      {
          if (isEmpty(str)) {
              return str;
          }
  
          int start = 0;
          int end = str.indexOf(c, start);
          if (end == INDEX_NOT_FOUND) {
              return str;
          }
  
          final StringBuilder buf = new StringBuilder(str.length() + 1);
  
          do {
              end += 1;
              buf.append(str.substring(start, end)).append(c);
  
              start = end;
              end = str.indexOf(c, start);
          } while (end != INDEX_NOT_FOUND);
  
          buf.append(str.substring(start));
  
          return buf.toString();
      }
docs: An attempt to make doubling a character (usually for escaping purposes) as fast as it can be. A lot faster than
  the usual <code>mystring.replace("a", "aa")</code> for example.
  
  @param str the string to modify
  @param c the character to double
  @return the modified string