ThrowIfNotContainsAny Method
Definition
ThrowIfNotContainsAny(string, char[], StringComparison, string, string)
Validates and throws an ArgumentOutOfRangeException if any of the characters does not occur within the argument.
public static void ThrowIfNotContainsAny(string argument, char[] characters, StringComparison comparison = StringComparison.OrdinalIgnoreCase, string message = "No matching characters were found.", string paramName = null)
Parameters
argumentstringThe value to be evaluated.
characterschar[]The sequence of char to search within
argument.comparisonStringComparisonOne of the enumeration values that specifies the rules to use in the comparison.
messagestringThe message that describes the error.
paramNamestringThe name of the parameter that caused the exception.
Exceptions
- ArgumentOutOfRangeException
argumentdoes not contain any of the specifiedcharacters.