class StringUtilities {

	public static String convertEscapeSequences(String str) {
		StringBuilder builder = new StringBuilder();

		int inputLength = str.length();
		int index = 0;
		while (index < inputLength) {
			String subOfInput = (index + 2 <= inputLength) ? str.substring(index, index + 2)
					: str.substring(index, inputLength);
			Character escapeChar = escapeStringToControlMap.get(subOfInput);
			if (escapeChar != null) {
				builder.append(escapeChar);
				index += 2;
			}
			else if (handleEscapeSequence(str, "\\x", 2, index, builder)) {
				index += 4;
			}
			else if (handleEscapeSequence(str, "\\u", 4, index, builder)) {
				index += 6;
			}
			else if (handleEscapeSequence(str, "\\U", 8, index, builder)) {
				index += 10;
			}
			else {
				builder.append(str.charAt(index));
				index++;
			}
		}
		return builder.toString();
	}

	private  StringUtilities();

}