다음을 통해 공유


StringAssert.Contains Method

Definition

Overloads

Contains()

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains()

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains()

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

public:
 static void Contains(System::String ^ value, System::String ^ substring, System::String ^ message, StringComparison comparisonType);
public static void Contains (string value, string substring, string message, StringComparison comparisonType);
static member Contains : string * string * string * StringComparison -> unit
Public Shared Sub Contains (value As String, substring As String, message As String, comparisonType As StringComparison)

Exceptions

Thrown if substring is not found in value.

Applies to

Contains()

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

public:
 static void Contains(System::String ^ value, System::String ^ substring, StringComparison comparisonType);
public static void Contains (string value, string substring, StringComparison comparisonType);
static member Contains : string * string * StringComparison -> unit
Public Shared Sub Contains (value As String, substring As String, comparisonType As StringComparison)

Exceptions

Thrown if substring is not found in value.

Applies to