StringAssert.EndsWith Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
EndsWith(String, String, String, StringComparison, Object[]) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String, String, StringComparison) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String, String, Object[]) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String, StringComparison) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String, String) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String) |
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring. |
EndsWith(String, String, String, StringComparison, Object[])
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring, string message, StringComparison comparisonType, params object[] parameters);
public static void EndsWith (string? value, string? substring, string? message, StringComparison comparisonType, params object?[]? parameters);
static member EndsWith : string * string * string * StringComparison * obj[] -> unit
Public Shared Sub EndsWith (value As String, substring As String, message As String, comparisonType As StringComparison, ParamArray parameters As Object())
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
- message
- String
The message to include in the exception when value
does not end with substring
. The message is
shown in test results.
- comparisonType
- StringComparison
The comparison method to compare strings comparisonType
.
- parameters
- Object[]
An array of parameters to use when formatting message
.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.
Applies to
EndsWith(String, String, String, StringComparison)
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring, string message, StringComparison comparisonType);
public static void EndsWith (string? value, string? substring, string? message, StringComparison comparisonType);
static member EndsWith : string * string * string * StringComparison -> unit
Public Shared Sub EndsWith (value As String, substring As String, message As String, comparisonType As StringComparison)
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
- message
- String
The message to include in the exception when value
does not end with substring
. The message is
shown in test results.
- comparisonType
- StringComparison
The comparison method to compare strings comparisonType
.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.
Applies to
EndsWith(String, String, String, Object[])
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring, string message, params object[] parameters);
public static void EndsWith (string? value, string? substring, string? message, params object?[]? parameters);
static member EndsWith : string * string * string * obj[] -> unit
Public Shared Sub EndsWith (value As String, substring As String, message As String, ParamArray parameters As Object())
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
- message
- String
The message to include in the exception when value
does not end with substring
. The message is
shown in test results.
- parameters
- Object[]
An array of parameters to use when formatting message
.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.
Applies to
EndsWith(String, String, StringComparison)
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring, StringComparison comparisonType);
public static void EndsWith (string? value, string? substring, StringComparison comparisonType);
static member EndsWith : string * string * StringComparison -> unit
Public Shared Sub EndsWith (value As String, substring As String, comparisonType As StringComparison)
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
- comparisonType
- StringComparison
The comparison method to compare strings comparisonType
.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.
Applies to
EndsWith(String, String, String)
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring, string message);
public static void EndsWith (string? value, string? substring, string? message);
static member EndsWith : string * string * string -> unit
Public Shared Sub EndsWith (value As String, substring As String, message As String)
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
- message
- String
The message to include in the exception when value
does not end with substring
. The message is
shown in test results.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.
Applies to
EndsWith(String, String)
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
- Source:
- StringAssert.cs
Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.
public static void EndsWith (string value, string substring);
public static void EndsWith (string? value, string? substring);
static member EndsWith : string * string -> unit
Public Shared Sub EndsWith (value As String, substring As String)
Parameters
- value
- String
The string that is expected to end with substring
.
- substring
- String
The string expected to be a suffix of value
.
Exceptions
value
is null, or substring
is null,
or value
does not end with substring
.