StringExtensionsIndexOfAny(String, StringComparison, String) Method
Gets the zero-based index of the first occurrence in the specified
String s of any of the strings in the specified
set using a specific
comparison.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.0.0
public static int IndexOfAny(
this string s,
StringComparison comparison,
params string[] set
)
<ExtensionAttribute>
Public Shared Function IndexOfAny (
s As String,
comparison As StringComparison,
ParamArray set As String()
) As Integer
public:
[ExtensionAttribute]
static int IndexOfAny(
String^ s,
StringComparison comparison,
... array<String^>^ set
)
[<ExtensionAttribute>]
static member IndexOfAny :
s : string *
comparison : StringComparison *
set : string[] -> int
- s String
- A String instance that is to be compared to each element of the set.
- comparison StringComparison
- The StringComparison to use.
- set String
- An Array of strings.
Int32The zero-based index of the first occurrence in the specified
String s of any of the strings in the specified
set,
or -1 if none of the strings of
set are found in
s.In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).