Table of Contents

ContainsAny Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/StringExtensions.cs

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

value string

The string to extend.

values string[]

The string sequence to search within value.

Returns

bool

true if any of the values occurs within the value; 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

value string

The string to extend.

comparison StringComparison

One of the enumeration values that specifies the rules to use in the comparison.

values string[]

The string sequence to search within value.

Returns

bool

true if any of the values occurs within the value; otherwise, false.

Exceptions

ArgumentNullException

value is null -or- values is 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

value string

The string to extend.

find string

The string to find within value.

comparison StringComparison

One of the enumeration values that specifies the rules to use in the comparison. Default is OrdinalIgnoreCase.

Returns

bool

true if the find parameter occurs within the value; otherwise, false.

Exceptions

ArgumentNullException

value is null -or- find is 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

value string

The string to extend.

comparison StringComparison

One of the enumeration values that specifies the rules to use in the comparison.

values char[]

The char sequence to search within value.

Returns

bool

true if the values parameter occurs within the value; otherwise, false.

Exceptions

ArgumentNullException

value is null -or- values is 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

value string

The string to extend.

find char

The char to search within value.

comparison StringComparison

One of the enumeration values that specifies the rules to use in the comparison. Default is OrdinalIgnoreCase.

Returns

bool

true if the find parameter occurs within the value; otherwise, false.

Exceptions

ArgumentNullException

value is null -or- find is 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

value string

The string to extend.

values char[]

The char sequence to search within value.

Returns

bool

true if the values parameter occurs within the value; 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.