protected boolean shouldTrim(int character) {
    for (int i = 0; i < trimChars.length; ++i) {
      if (trimChars[i] == character) {
        return true;
      }
    }
    return false;
  }
This is a superclass for binary string functions that operate directly on the
input and set the output. First parameter is a column second is a scalar.
It is suitable for direct, in-place operations on
strings, such as for fast implementations of two parameter version of  TRIM(), LTRIM(), and RTRIM().
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/StringTrimColScalarBase.java