private static boolean hasChar(char[] chars, char character) {
    for (char target : chars) {
      if (character == target) {
        return true;
      }
    }
    return false;
  }
Escape <code>charToEscape</code> in the string
with the escape char <code>escapeChar</code>

@param str string
@param escapeChar escape char
@param charToEscape the char to be escaped
@return an escaped string
common/src/java/org/apache/hive/common/util/HiveStringUtils.java