public static String[] getTrimmedStrings(String str){
    if (null == str || "".equals(str.trim())) {
      return emptyStringArray;
    }

    return str.trim().split("\\s*,\\s*");
  }
Splits a comma separated value <code>String</code>, trimming leading and trailing whitespace on each value.
@param str a comma separated <code>String</code> with values
@return an array of <code>String</code> values
common/src/java/org/apache/hive/common/util/HiveStringUtils.java