ContainsAny Method
Definition
- Namespace
- Cuemon.Extensions
- Assemblies
- Cuemon.Extensions.Core.dll
ContainsAny(string, params string[])
Returns a value indicating whether any of the specified values occurs within the value.
public static bool ContainsAny(this string value, params string[] values)
Parameters
Returns
- bool
trueif any of thevaluesoccurs within thevalue; otherwise,false.
Remarks
This method performs an ordinal (case-insensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.
ContainsAny(string, StringComparison, params string[])
Returns a value indicating whether any of the specified values occurs within the value.
public static bool ContainsAny(this string value, StringComparison comparison, params string[] values)
Parameters
valuestringThe string to extend.
comparisonStringComparisonOne of the enumeration values that specifies the rules to use in the comparison.
valuesstring[]The string sequence to search within
value.
Returns
- bool
trueif any of thevaluesoccurs within thevalue; otherwise,false.
Exceptions
- ArgumentNullException
valueis null -or-valuesis null.
ContainsAny(string, string, StringComparison)
Returns a value indicating whether the specified find occurs within the value.
public static bool ContainsAny(this string value, string find, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
Parameters
valuestringThe string to extend.
findstringThe string to find within
value.comparisonStringComparisonOne of the enumeration values that specifies the rules to use in the comparison. Default is OrdinalIgnoreCase.
Returns
- bool
trueif thefindparameter occurs within thevalue; otherwise,false.
Exceptions
- ArgumentNullException
valueis null -or-findis null.
ContainsAny(string, StringComparison, params char[])
Returns a value indicating whether the specified values occurs within the value object.
public static bool ContainsAny(this string value, StringComparison comparison, params char[] values)
Parameters
valuestringThe string to extend.
comparisonStringComparisonOne of the enumeration values that specifies the rules to use in the comparison.
valueschar[]The char sequence to search within
value.
Returns
- bool
trueif thevaluesparameter occurs within thevalue; otherwise,false.
Exceptions
- ArgumentNullException
valueis null -or-valuesis null.
ContainsAny(string, char, StringComparison)
Returns a value indicating whether the specified find occurs within the value.
public static bool ContainsAny(this string value, char find, StringComparison comparison = StringComparison.OrdinalIgnoreCase)
Parameters
valuestringThe string to extend.
findcharThe char to search within
value.comparisonStringComparisonOne of the enumeration values that specifies the rules to use in the comparison. Default is OrdinalIgnoreCase.
Returns
- bool
trueif thefindparameter occurs within thevalue; otherwise,false.
Exceptions
- ArgumentNullException
valueis null -or-findis null.
ContainsAny(string, params char[])
Returns a value indicating whether the specified values occurs within the value object.
public static bool ContainsAny(this string value, params char[] values)
Parameters
Returns
- bool
trueif thevaluesparameter occurs within thevalue; otherwise,false.
Remarks
This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.