Trims every string in the specified strings array.

@param strings the specified strings array, returns {@code null} if the
specified strings is {@code null}
@return a trimmed strings array
175
public static String[] trimAll(final String[] strings) {
        if (null == strings) {
            return null;
        }

        return Arrays.stream(strings).map(StringUtils::trim).toArray(size -> new String[size]);
    }
935119
private static boolean deepEmpty(final String[] strings) {
        if (strings != null) {
            for (final String s : strings) {
                if (StringUtils.isNotEmpty(s)) {
                    return false;
                }
            }
        }
        return true;
    }
1347151
public static String trim(String string)
  {
    if(string == null) {
      return null;
    }
    int length = string.length();
    int beginIndex = 0;
    for(; beginIndex < length; ++beginIndex) {
      if(!Character.isWhitespace(string.charAt(beginIndex))) break;
    }
    int endIndex = length - 1;
    for(; endIndex >= 0; --endIndex) {
      if(!Character.isWhitespace(string.charAt(endIndex))) break;
    }
    return string.substring(beginIndex, endIndex + 1);
  }
315131
public static String emptyToNull(String string) {
    return string == null || string.isEmpty() ? null : string;
  }
886598
public static String trimWhitespaceToNull(final String s) {
        final String result = trimWhitespace(s);
        return StringUtils.isEmpty(result) ? null : s;
    }
775832
static function TrimLeft($string, $chars = null)
    {
        self::InitEncoding();
        if (!$chars)
            return ltrim($chars);

        return ltrim($string, $chars);
    }
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]);
    }
300867
public static String trim(String str, String arg) {
        if (str == null || arg == null) {
            throw new NullPointerException("str or arg must not be null");
        }

        while (str.startsWith(arg)) {
            str = str.substring(arg.length());
        }

        while (str.endsWith(arg)) {
            str = str.substring(0, str.length() - arg.length());
        }
        return str;
    }
1143170
public static Optional<String> trimStart(final String input, String... chars) {
        return Optional.ofNullable(input).filter(v -> !v.isEmpty()).map(v -> {
            String pattern = String.format("^[%s]+", join(chars, "\\"));
            return v.replaceAll(pattern, "");
        });
    }
1088755
public static String trim(String str) {
		return str != null && str.length() > 0 ? str.trim() : str;
	}
258815
public void set(final Iterable<String> strings) {
    checkNotNull(strings);
    candidates.clear();
    addAll(strings);
  }
1215323
@SuppressWarnings("unchecked")
	protected HashSet<String> getSetOfStrings(Object strings)
	{
		try {
			return (HashSet<String>) strings;
		} catch (ClassCastException ex) {
			Collection<String> list = (Collection<String>) strings;
			return new HashSet<String>(list);
		}
	}
691384
public static boolean contains(final String string, final String[] strings) {
        if (null == strings) {
            return false;
        }

        return Arrays.stream(strings).anyMatch(str -> StringUtils.equals(string, str));
    }
773896
public static String maxLengthString(String... strings) {
        String res = "";
        for (String string : strings) {
            if (string.length() > res.length()) {
                res = string;
            }
        }
        return res;
    }
167543
public static boolean areValid(String... strings) {
		boolean result = false;
		if(strings != null) {
			result = true;
			for(String string : strings) {
				result = result && isValid(string);
			}
		}
		return result;
	}
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 "";
    }
517518
@Nullable
    public static String trimToNull(@Nullable String string) {
        return Optional.ofNullable(string)
                .map(String::trim)
                .filter(StringUtils::isNotEmpty)
                .orElse(null);
    }