切分字符串，忽略大小写

@param str 被切分的字符串
@param separator 分隔符字符串
@param limit 限制分片数
@param isTrim 是否去除切分字符串后每个元素两边的空格
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.2.1
328499
public static List<String> splitIgnoreCase(String str, String separator, int limit, boolean isTrim, boolean ignoreEmpty){
		return split(str, separator, limit, isTrim, ignoreEmpty, true);
	}
820829
public static int getDelimIndex(StringBuilder sb, int itemPos, char[] delims, boolean ignoreEmpty) {

	if (StringUtil.isEmpty(sb)) return -1;

	int curr = -1, listIndex = 0;
	int len = sb.length();
	for (int i = 0; i < len; i++) {
	    if (contains(delims, sb.charAt(i))) {
		curr = i;
		if (ignoreEmpty) {
		    if (i == 0 || (i + 1 < len && contains(delims, sb.charAt(i + 1)))) {
			sb.delete(curr, curr + 1);
			len--;
			i--;
			curr--;
			continue;
		    }
		}
		if (++listIndex == itemPos) break;
	    }
	}
	if (listIndex < itemPos) return len;
	return curr;
    }
1081348
public static List<String> split(String str, char sepChr) {
    	List<String> result = new ArrayList<String>();
    	int idx = 0;
    	while(true) {
    		int idx2 = str.indexOf(sepChr, idx);
    		if(idx2 < 0) {
    			result.add(str.substring(idx));
    			break;
    		}
    		result.add(str.substring(idx, idx2));
    		idx = idx2 + 1;
    	}
        return result;
    }
705767
public static String join(Collection<? extends Object> lst, String separator) {
        StringBuilder buf = new StringBuilder(lst.size() * 64);
        boolean first = true;
        for (Object value : lst) {
            if (first) first = false; else buf.append(separator);
            buf.append(value.toString());
        }
        return buf.toString();
    }
537750
public static String rtrim(String str, String defaultValue) {
	if (str == null) return defaultValue;
	int len = str.length();

	while ((0 < len) && (str.charAt(len - 1) <= ' ')) {
	    len--;
	}
	return (len < str.length()) ? str.substring(0, len) : str;
    }
291539
public static function increment(string $str, int $first = 1, string $separator = '_') : string
    {
        preg_match('/(.+)'.$separator.'([0-9]+)$/', $str, $match);

        return isset($match[2]) ? $match[1].$separator.($match[2] + 1) : $str.$separator.$first;
    }
671432
public static boolean skipUntil(InputStream in, byte separator) throws IOException {
        int r;
        while((r = in.read()) >= 0) {
            if(((byte) r) == separator) { return true; }
        }
        return false;
    }
550642
private String wrapLine(String str) {
	int wtl = wraptext;

	if (str.length() <= wtl) return str;

	String sub = str.substring(0, wtl);
	String rest = str.substring(wtl);
	char firstR = rest.charAt(0);
	String ls = System.getProperty("line.separator");

	if (firstR == ' ' || firstR == '\t') return sub + ls + wrapLine(rest.length() > 1 ? rest.substring(1) : "");

	int indexSpace = sub.lastIndexOf(' ');
	int indexTab = sub.lastIndexOf('\t');
	int index = indexSpace <= indexTab ? indexTab : indexSpace;

	if (index == -1) return sub + ls + wrapLine(rest);
	return sub.substring(0, index) + ls + wrapLine(sub.substring(index + 1) + rest);

    }
1355863
public static boolean isDelimiter(String str)
    {
        if (str != null && ("-".equals(str) || "－".equals(str)))
            return true;
        else
            return false;
    }
1050188
public static Long parseLong(final String str) {
        if (null != str) {
            try {
                return new Long(Long.parseLong(str.trim()));
            } catch (final Exception e) {
                // :IGNORE:
            }
        }
        return null;
    }
152748
public static String[] splitLongString(String str, char separator)
    {
        int len = (str == null) ? 0 : str.length();
        if (str == null || len == 0)
        {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }

        int       oldPos = 0;
        ArrayList list = new ArrayList();
        int pos = str.indexOf(separator);
        while(pos >= 0)
        {
            list.add(substring(str, oldPos, pos));
            oldPos = (pos + 1);
            pos = str.indexOf(separator, oldPos);
        }


        list.add(substring(str, oldPos, len));

        return (String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
    }
570687
public static String padOrTrim(String str, int num) {
    if (str == null) {
      str = "null";
    }
    int leng = str.length();
    if (leng < num) {
      StringBuilder sb = new StringBuilder(str);
      for (int i = 0; i < num - leng; i++) {
        sb.append(' ');
      }
      return sb.toString();
    } else if (leng > num) {
      return str.substring(0, num);
    } else {
      return str;
    }
  }
247795
@SuppressWarnings("rawtypes")
    public static String join(final Collection<?> col, final String separator,
            final boolean ignoreEmptyElement, final boolean trim, final ElementConverter elementConverter) {

        final List<Object> list = new ArrayList<Object>();
        for(Object element : col) {
            if(element == null) {
                continue;
            }

            Object value = element;

            if(element instanceof String) {
                String str = (String) element;
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim();
                }

            } else if(element instanceof Character && isEmpty(element.toString())) {
                String str = element.toString();
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim().charAt(0);
                }

            } else if(char.class.isAssignableFrom(element.getClass())) {
                String str = element.toString();
                if(ignoreEmptyElement && isEmpty(str)) {
                    continue;

                } else if(trim) {
                    value = str.trim().charAt(0);
                }
            }

            list.add(value);

        }

        return join(list, separator, elementConverter);

    }
885047
protected String nullIfEmpty(String str) {
        return (str == null || str.trim().length() == 0) ? null : str;
    }
797642
private Node tryFoldStringSplit(Node n, Node stringNode, Node arg1) {
    if (late) {
      return n;
    }

    checkArgument(n.isCall());
    checkArgument(stringNode.isString());

    String separator = null;
    String stringValue = stringNode.getString();

    // Maximum number of possible splits
    int limit = stringValue.length() + 1;

    if (arg1 != null) {
      if (arg1.isString()) {
        separator = arg1.getString();
      } else if (!arg1.isNull()) {
        return n;
      }

      Node arg2 = arg1.getNext();
      if (arg2 != null) {
        if (arg2.isNumber()) {
          limit = Math.min((int) arg2.getDouble(), limit);
          if (limit < 0) {
            return n;
          }
        } else {
          return n;
        }
      }
    }

    // Split the string and convert the returned array into JS nodes
    String[] stringArray = jsSplit(stringValue, separator, limit);
    Node arrayOfStrings = IR.arraylit();
    for (String element : stringArray) {
      arrayOfStrings.addChildToBack(IR.string(element).srcref(stringNode));
    }

    Node parent = n.getParent();
    parent.replaceChild(n, arrayOfStrings);
    reportChangeToEnclosingScope(parent);
    return arrayOfStrings;
  }
1351378
public static String ltrim(String str, String defaultValue) {
	if (str == null) return defaultValue;
	int len = str.length();
	int st = 0;

	while ((st < len) && (str.charAt(st) <= ' ')) {
	    st++;
	}
	return ((st > 0)) ? str.substring(st) : str;
    }
210792
public static boolean isEmpty(final String str, final boolean trim) {
	if (!trim) return isEmpty(str);
	return str == null || str.trim().length() == 0;
    }