Replaces the strings "\r", "\n" and "\t" with "carriage return", "new line" and "tab" character.

@param str
String to replace or <code>null</code>.

@return Replaced string or <code>null</code>.
490099
public static String replaceCrLfTab(final String str) {
        if (str == null) {
            return null;
        }
        final int len = str.length();
        final StringBuilder sb = new StringBuilder();
        int i = 0;
        while (i < len) {
            final char ch = str.charAt(i++);
            if (ch == '\\') {
                if (i < len) {
                    final char next = str.charAt(i);
                    final Character replacement = SPECIAL_CHAR_REPLACEMENT_MAP.get(next);
                    if (replacement != null) {
                        sb.append(replacement);
                        i++;
                    } else {
                        sb.append(ch);
                    }
                } else {
                    sb.append(ch);
                }
            } else {
                sb.append(ch);
            }
        }
        return sb.toString();
    }
921866
public String toTrad(String str) {   
		char[] c = str.toCharArray();
		for (int i = 0; i < str.length(); i++) {   
			char cc = s2l.get(c[i]);
			if (cc != 0) {   
				c[i] = cc;   
			} 
		}   
		return new String(c);   
	}
1097815
protected static final String underbarStringToSentence(String str) {
        if (str == null) {
            return null;
        }
        char[] buf = new char[str.length()];
        // preserve case of first character
        buf[0] = str.charAt(0);
        for (int i = 1; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c >= 'A' && c <= 'Z') {
                c += 0x20;
            } else if (c == 0x5f) {
                // convert underbar to space
                c = 0x20;
            }
            buf[i] = c;
        }
        return new String(buf);
    }
407762
function (str) {

		var self = this;

		if ('i' !== 'I'.toLowerCase()) {
			// Thanks for http://qiita.com/niusounds/items/fff91f3f236c31ca910f
			return str.replace(/[a-z]/g, function(ch) {
				return String.fromCharCode(ch.charCodeAt(0) & ~32);
			});
		}

		return str.toUpperCase();

	}
87669
private static String cleanString(String str)
    {
	String result = str;
	result = result.replace("\r", "");
	result = result.replace("\n", "");
	result = result.replace("\t", "");

	return result;
    }
1251740
public static String dequote(String str, char quote)
    {
        // Is there anything to dequote?
        if (str == null)
        {
            return null;
        }

        return dequote(str, 0, str.length(), quote);
    }
709789
private static final String escape(String str) {
        if (str == null) {
            return null;
        }

        StringBuilder sb = new StringBuilder(str.length() * 2);
        int len = str.length();
        for (int i = 0; i < len; i++) {
            char c = str.charAt(i);
            switch (c) {
                case TOKEN_DELIM:
                case USER_DATA_DELIM:
                case USER_ATTRIB_DELIM:
                    sb.append('\\');
                    break;
                default:
                    break;
            }
            sb.append(c);
        }
        return sb.toString();
    }
1025427
public static String replace(final String str, final Map<String, String> params) {
        final StringBuilder sb = new StringBuilder(str.length());
        final char[] strArray = str.toCharArray();
        int i = 0;
        while (i < strArray.length - 1) {
            if (strArray[i] == VAR_START && strArray[i + 1] == VAR_LEFT_BOUND) {
                i = i + 2;
                final int begin = i;
                while (strArray[i] != VAR_RIGHT_BOUND) {
                    ++i;
                }
                final String var = str.substring(begin, i++);
                Preconditions.checkState(params.containsKey(var), "No value provided for variable '%s' "
                        + "in string '%s'", var, str);
                final String value = params.get(var).trim();
                sb.append(value);
            } else {
                sb.append(strArray[i]);
                ++i;
            }
        }
        if (i < strArray.length) {
            sb.append(strArray[i]);
        }
        return sb.toString();
    }
583285
private String replaceScriptEscapeAndNewLines(String str) {
        StringBuilder result = new StringBuilder(str.length());
        char c = '\0';
        char prevC = '\0';
        boolean atEscape = false;
        for (int i = 0; i < str.length(); i++) {
            prevC = c;
            c = str.charAt(i);
            // set atEscape flag
            if (c == '\\') {
                // deal with 2nd '\\' char
                if (atEscape) {
                    result.append(c);
                    atEscape = false;
                    // set c to '\0' so that prevC doesn't match '\\'
                    // the next time round
                    c = '\0';
                } else {
                    atEscape = true;
                }
            } else if (atEscape) {
                if (c == 'n') {
                    result.append("\n");
                } else {
                    result.append(c);
                }
            } else {
                result.append(c);
            }
            // unset atEscape flag if required
            if (prevC == '\\') {
                if (atEscape) {
                    atEscape = false;
                }
            }
        }
        return result.toString();
    }
490187
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();
	}
405439
function (str) {
        return btoa(String.fromCharCode.apply(null,
            str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" "))
        );
    }
430875
public static String toLowerFirstChar(final String str)
    {
        return Character.toLowerCase(str.charAt(0)) + str.substring(1);
    }
1314521
public static String escapeChars(String str, String chars) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);

            if (chars.indexOf(c) >= 0) {
                sb.append('\\');
            }

            sb.append(c);
        }

        return sb.toString();
    }
1245805
@Nullable
  public static String quote(@Nullable final String str) {
    return str != null ? "'" + str + "'" : null;
  }
885047
protected String nullIfEmpty(String str) {
        return (str == null || str.trim().length() == 0) ? null : str;
    }
1366365
function (str) {
	   return str.replace(/[àáâãäå]/g,"a").
					  replace(/[èéêë]/g,"e").
					  replace(/[ìíîï]/g,"i").
					  replace(/[òóôõö]/g,"o").
					  replace(/[ùúûü]/g,"u").
					  replace(/[ýÿ]/g,"y").
					  replace(/[ñ]/g,"n").
					  replace(/[ç]/g,"c").
					  replace(/[œ]/g,"oe").
					  replace(/[æ]/g,"ae");
	}
633285
public static String replaceAllEmojis(String str, final String replacementString) {
    EmojiParser.EmojiTransformer emojiTransformer = new EmojiParser.EmojiTransformer() {
      public String transform(EmojiParser.UnicodeCandidate unicodeCandidate) {
        return replacementString;
      }
    };

    return parseFromUnicode(str, emojiTransformer);
  }