Trims all elements inside the array, modifying the original array.

@param strings The string array
@return The passed string array, trimmed
551882
public static String[] trimArray(String[] strings) {
        for (int i = 0; i < strings.length; i++) {
            strings[i] = strings[i].trim();
        }
        return strings;
    }
1082836
private static String pickDelimiter(String[] strings) {
    boolean allLength1 = true;
    for (String s : strings) {
      if (s.length() != 1) {
        allLength1 = false;
        break;
      }
    }

    if (allLength1) {
      return "";
    }

    String[] delimiters = new String[]{" ", ";", ",", "{", "}", null};
    int i = 0;
    NEXT_DELIMITER: for (; delimiters[i] != null; i++) {
      for (String cur : strings) {
        if (cur.contains(delimiters[i])) {
          continue NEXT_DELIMITER;
        }
      }
      break;
    }
    return delimiters[i];
  }
378600
public static String 
    trimRight( String string ) 
    {
    	for( int i = string.length(); i > 0; --i )
    	{
    		if( string.charAt(i-1) != ' '
    		&& string.charAt(i-1) != '\t'
    		&& string.charAt(i-1) != '\n'
    		&& string.charAt(i-1) != '\r' ) 
    		{    			
    			return i == string.length() ? string : 
    			                              string.substring( 0, i );
    		}
    	}
    	return "";
    }
922049
public static String[] removeEmptyStrings(String[] strings) {
        if (Objects.isNull(strings)) {
            throw new IllegalArgumentException("Input array should not be null");
        }
        return Arrays.stream(strings).filter(str -> str != null && !str.trim().isEmpty()).toArray(String[]::new);
    }
659876
public static String[] trim(final String... aStringArray) {
        final ArrayList<String> list = new ArrayList<>();

        for (final String string : aStringArray) {
            if (string != null && !"".equals(string)) {
                list.add(string);
            }
        }

        return list.toArray(new String[0]);
    }
1322660
static String[] split( String selectors ) {
        ArrayList<String> result = null;
        int length = selectors.length();
        char quote = 0;
        int off = 0;
        for( int i = 0; i < length; i++ ) {
            char ch = selectors.charAt( i );
            switch( ch ) {
                case ',':
                    if( result == null ) {
                        result = new ArrayList<>();
                    }
                    result.add( selectors.substring( off, i ).trim() );
                    off = i + 1;
                    break;
                case '\'':
                case '\"':
                    do {
                        i++;
                    } while( i < length && selectors.charAt( i ) != ch );
            }
        }
        if( result == null ) {
            return new String[] { selectors.trim() };
        }
        result.add( selectors.substring( off, length ).trim() );
        return result.toArray( new String[result.size()] );
    }
215021
protected function pop(array $strings)
	{
		$cnt = count($strings);
		$i   = $cnt;
		while (--$i >= 0)
		{
			array_pop($strings[$i]);
		}

		// Remove empty elements then prepend one back at the start of the array if applicable
		$strings = array_filter($strings);
		if (count($strings) < $cnt)
		{
			array_unshift($strings, []);
		}

		return $strings;
	}
815947
public static @Nullable String trim(@Nullable String s) {
		return (s != null ? s.trim() : s);
	}
844495
public static Matcher<String> containsStrings(String... strings) {
        List<Matcher<? super String>> matchers = new ArrayList<Matcher<? super String>>();
        for (String string : strings) {
            matchers.add(containsString(string));
        }
        return allOf(matchers);
    }
665534
public static String[] split(String strings, String separator) {
		return split(strings, separator, DEFAULT_TRIM);
	}
1351415
public function trim($string, $charlist = null)
    {
        $string = (string)$string;

        if ($charlist === null) {
            return trim($string);
        } else {
            return trim($string, $charlist);
        }
    }
1126198
@SafeVarargs
    public static short[] removeAll(final short[] a, final short... elements) {
        if (N.isNullOrEmpty(a)) {
            return N.EMPTY_SHORT_ARRAY;
        } else if (N.isNullOrEmpty(elements)) {
            return a.clone();
        } else if (elements.length == 1) {
            return removeAllOccurrences(a, elements[0]);
        }

        final ShortList list = ShortList.of(a.clone());
        list.removeAll(ShortList.of(elements));
        return list.trimToSize().array();
    }
468447
public static String trim(String str, String defaultValue) {
	if (str == null) return defaultValue;
	return str.trim();
    }
893245
public static String trim(String list, String delimiter) {
	return trim(list, delimiter, new int[2], false);
    }
453169
public static function trim($string, $needle, $trimAll = true) {
		$string = self::rtrim($string, $needle, $trimAll);
		$string = self::ltrim($string, $needle, $trimAll);

		return $string;
	}
197537
public static String removeQuotes(String string, boolean trim) {
	if (string == null) return string;
	if (trim) string = string.trim();
	if (string.length() < 2) return string;

	if ((StringUtil.startsWith(string, '"') && StringUtil.endsWith(string, '"')) || (StringUtil.startsWith(string, '\'') && StringUtil.endsWith(string, '\''))) {
	    string = string.substring(1, string.length() - 1);
	    if (trim) string = string.trim();
	}
	return string;
    }
1015562
public static String[] removeDuplicateStrings(String[] array) {
        if (isEmpty(array)) {
            return array;
        }
        Set<String> set = new TreeSet<String>();
        Collections.addAll(set, array);
        return toStringArray(set);
    }