Table of Contents

Class StringAsserts

Namespace
Asserts
Assembly
xunit.v3.assert.dll
public class StringAsserts
Inheritance
StringAsserts
Inherited Members

Methods

Contains(Memory<char>, Memory<char>)

Verifies that a string contains a given sub-string, using the current culture.

public static void Contains(Memory<char> expectedSubstring, Memory<char> actualString)

Parameters

expectedSubstring Memory<char>

The sub-string expected to be in the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(Memory<char>, Memory<char>, StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

public static void Contains(Memory<char> expectedSubstring, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Memory<char>

The sub-string expected to be in the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(Memory<char>, ReadOnlyMemory<char>)

Verifies that a string contains a given sub-string, using the current culture.

public static void Contains(Memory<char> expectedSubstring, ReadOnlyMemory<char> actualString)

Parameters

expectedSubstring Memory<char>

The sub-string expected to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(Memory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

public static void Contains(Memory<char> expectedSubstring, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Memory<char>

The sub-string expected to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(ReadOnlyMemory<char>, Memory<char>)

Verifies that a string contains a given sub-string, using the current culture.

public static void Contains(ReadOnlyMemory<char> expectedSubstring, Memory<char> actualString)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected to be in the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(ReadOnlyMemory<char>, Memory<char>, StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

public static void Contains(ReadOnlyMemory<char> expectedSubstring, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected to be in the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(ReadOnlyMemory<char>, ReadOnlyMemory<char>)

Verifies that a string contains a given sub-string, using the current culture.

public static void Contains(ReadOnlyMemory<char> expectedSubstring, ReadOnlyMemory<char> actualString)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

public static void Contains(ReadOnlyMemory<char> expectedSubstring, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(ReadOnlySpan<char>, ReadOnlySpan<char>)

Verifies that a string contains a given string, using the current culture.

public static void Contains(ReadOnlySpan<char> expectedSubstring, ReadOnlySpan<char> actualString)

Parameters

expectedSubstring ReadOnlySpan<char>

The string expected to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string contains a given string, using the given comparison type.

public static void Contains(ReadOnlySpan<char> expectedSubstring, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlySpan<char>

The string expected to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(ReadOnlySpan<char>, Span<char>)

Verifies that a string contains a given string, using the current culture.

public static void Contains(ReadOnlySpan<char> expectedSubstring, Span<char> actualString)

Parameters

expectedSubstring ReadOnlySpan<char>

The string expected to be in the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(ReadOnlySpan<char>, Span<char>, StringComparison)

Verifies that a string contains a given string, using the given comparison type.

public static void Contains(ReadOnlySpan<char> expectedSubstring, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlySpan<char>

The string expected to be in the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(Span<char>, ReadOnlySpan<char>)

Verifies that a string contains a given string, using the current culture.

public static void Contains(Span<char> expectedSubstring, ReadOnlySpan<char> actualString)

Parameters

expectedSubstring Span<char>

The string expected to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(Span<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string contains a given string, using the given comparison type.

public static void Contains(Span<char> expectedSubstring, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Span<char>

The string expected to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(Span<char>, Span<char>)

Verifies that a string contains a given string, using the current culture.

public static void Contains(Span<char> expectedSubstring, Span<char> actualString)

Parameters

expectedSubstring Span<char>

The string expected to be in the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(Span<char>, Span<char>, StringComparison)

Verifies that a string contains a given string, using the given comparison type.

public static void Contains(Span<char> expectedSubstring, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Span<char>

The string expected to be in the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string is not present inside the string

Contains(string, string?)

Verifies that a string contains a given sub-string, using the current culture.

public static void Contains(string expectedSubstring, string? actualString)

Parameters

expectedSubstring string

The sub-string expected to be in the string

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

Contains(string, string?, StringComparison)

Verifies that a string contains a given sub-string, using the given comparison type.

public static void Contains(string expectedSubstring, string? actualString, StringComparison comparisonType)

Parameters

expectedSubstring string

The sub-string expected to be in the string

actualString string

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the sub-string is not present inside the string

DoesNotContain(Memory<char>, Memory<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(Memory<char> expectedSubstring, Memory<char> actualString)

Parameters

expectedSubstring Memory<char>

The sub-string expected not to be in the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Memory<char>, Memory<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(Memory<char> expectedSubstring, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Memory<char>

The sub-string expected not to be in the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Memory<char>, ReadOnlyMemory<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(Memory<char> expectedSubstring, ReadOnlyMemory<char> actualString)

Parameters

expectedSubstring Memory<char>

The sub-string expected not to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Memory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(Memory<char> expectedSubstring, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Memory<char>

The sub-string expected not to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlyMemory<char>, Memory<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(ReadOnlyMemory<char> expectedSubstring, Memory<char> actualString)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected not to be in the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlyMemory<char>, Memory<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(ReadOnlyMemory<char> expectedSubstring, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected not to be in the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlyMemory<char>, ReadOnlyMemory<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(ReadOnlyMemory<char> expectedSubstring, ReadOnlyMemory<char> actualString)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected not to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(ReadOnlyMemory<char> expectedSubstring, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlyMemory<char>

The sub-string expected not to be in the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlySpan<char>, ReadOnlySpan<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(ReadOnlySpan<char> expectedSubstring, ReadOnlySpan<char> actualString)

Parameters

expectedSubstring ReadOnlySpan<char>

The sub-string expected not to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(ReadOnlySpan<char> expectedSubstring, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlySpan<char>

The sub-string expected not to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlySpan<char>, Span<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(ReadOnlySpan<char> expectedSubstring, Span<char> actualString)

Parameters

expectedSubstring ReadOnlySpan<char>

The sub-string expected not to be in the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(ReadOnlySpan<char>, Span<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(ReadOnlySpan<char> expectedSubstring, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring ReadOnlySpan<char>

The sub-string expected not to be in the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Span<char>, ReadOnlySpan<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(Span<char> expectedSubstring, ReadOnlySpan<char> actualString)

Parameters

expectedSubstring Span<char>

The sub-string expected not to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Span<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(Span<char> expectedSubstring, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Span<char>

The sub-string expected not to be in the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Span<char>, Span<char>)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(Span<char> expectedSubstring, Span<char> actualString)

Parameters

expectedSubstring Span<char>

The sub-string expected not to be in the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(Span<char>, Span<char>, StringComparison)

Verifies that a string does not contain a given sub-string, using the given comparison type.

public static void DoesNotContain(Span<char> expectedSubstring, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedSubstring Span<char>

The sub-string expected not to be in the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(string, string?)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(string expectedSubstring, string? actualString)

Parameters

expectedSubstring string

The sub-string expected not to be in the string

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotContain(string, string?, StringComparison)

Verifies that a string does not contain a given sub-string, using the current culture.

public static void DoesNotContain(string expectedSubstring, string? actualString, StringComparison comparisonType)

Parameters

expectedSubstring string

The sub-string expected not to be in the string

actualString string

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotContainException

Thrown when the sub-string is present inside the string

DoesNotMatch(string, string?)

Verifies that a string does not match a regular expression.

public static void DoesNotMatch(string expectedRegexPattern, string? actualString)

Parameters

expectedRegexPattern string

The regex pattern expected not to match

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotMatchException

Thrown when the string matches the regex pattern

DoesNotMatch(Regex, string?)

Verifies that a string does not match a regular expression.

public static void DoesNotMatch(Regex expectedRegex, string? actualString)

Parameters

expectedRegex Regex

The regex expected not to match

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

DoesNotMatchException

Thrown when the string matches the regex

Empty(string)

Verifies that a string is empty.

public static void Empty(string value)

Parameters

value string

The string value to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ArgumentNullException

Thrown when the string is null

EmptyException

Thrown when the string is not empty

EndsWith(Memory<char>, Memory<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(Memory<char> expectedEndString, Memory<char> actualString)

Parameters

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Memory<char>, Memory<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(Memory<char> expectedEndString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Memory<char>, ReadOnlyMemory<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(Memory<char> expectedEndString, ReadOnlyMemory<char> actualString)

Parameters

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Memory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(Memory<char> expectedEndString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString Memory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlyMemory<char>, Memory<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(ReadOnlyMemory<char> expectedEndString, Memory<char> actualString)

Parameters

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlyMemory<char>, Memory<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(ReadOnlyMemory<char> expectedEndString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(ReadOnlyMemory<char> expectedEndString, ReadOnlyMemory<char> actualString)

Parameters

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(ReadOnlyMemory<char> expectedEndString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString ReadOnlyMemory<char>

The sub-string expected to be at the end of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlySpan<char>, ReadOnlySpan<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(ReadOnlySpan<char> expectedEndString, ReadOnlySpan<char> actualString)

Parameters

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(ReadOnlySpan<char> expectedEndString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlySpan<char>, Span<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(ReadOnlySpan<char> expectedEndString, Span<char> actualString)

Parameters

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(ReadOnlySpan<char>, Span<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(ReadOnlySpan<char> expectedEndString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString ReadOnlySpan<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Span<char>, ReadOnlySpan<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(Span<char> expectedEndString, ReadOnlySpan<char> actualString)

Parameters

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Span<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(Span<char> expectedEndString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Span<char>, Span<char>)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(Span<char> expectedEndString, Span<char> actualString)

Parameters

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(Span<char>, Span<char>, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(Span<char> expectedEndString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedEndString Span<char>

The sub-string expected to be at the end of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EndsWithException

Thrown when the string does not end with the expected sub-string

EndsWith(string?, string?)

Verifies that a string ends with a given sub-string, using the current culture.

public static void EndsWith(string? expectedEndString, string? actualString)

Parameters

expectedEndString string

The sub-string expected to be at the end of the string

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string does not end with the expected sub-string

EndsWith(string?, string?, StringComparison)

Verifies that a string ends with a given sub-string, using the given comparison type.

public static void EndsWith(string? expectedEndString, string? actualString, StringComparison comparisonType)

Parameters

expectedEndString string

The sub-string expected to be at the end of the string

actualString string

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string does not end with the expected sub-string

Equal(Memory<char>, Memory<char>)

Verifies that two strings are equivalent.

public static void Equal(Memory<char> expected, Memory<char> actual)

Parameters

expected Memory<char>

The expected string value.

actual Memory<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Memory<char>, Memory<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(Memory<char> expected, Memory<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected Memory<char>

The expected string value.

actual Memory<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Memory<char>, ReadOnlyMemory<char>)

Verifies that two strings are equivalent.

public static void Equal(Memory<char> expected, ReadOnlyMemory<char> actual)

Parameters

expected Memory<char>

The expected string value.

actual ReadOnlyMemory<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Memory<char>, ReadOnlyMemory<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(Memory<char> expected, ReadOnlyMemory<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected Memory<char>

The expected string value.

actual ReadOnlyMemory<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlyMemory<char>, Memory<char>)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlyMemory<char> expected, Memory<char> actual)

Parameters

expected ReadOnlyMemory<char>

The expected string value.

actual Memory<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlyMemory<char>, Memory<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlyMemory<char> expected, Memory<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected ReadOnlyMemory<char>

The expected string value.

actual Memory<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlyMemory<char>, ReadOnlyMemory<char>)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlyMemory<char> expected, ReadOnlyMemory<char> actual)

Parameters

expected ReadOnlyMemory<char>

The expected string value.

actual ReadOnlyMemory<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlyMemory<char>, ReadOnlyMemory<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlyMemory<char> expected, ReadOnlyMemory<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected ReadOnlyMemory<char>

The expected string value.

actual ReadOnlyMemory<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlySpan<char>, ReadOnlySpan<char>)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlySpan<char> expected, ReadOnlySpan<char> actual)

Parameters

expected ReadOnlySpan<char>

The expected string value.

actual ReadOnlySpan<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlySpan<char>, ReadOnlySpan<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlySpan<char> expected, ReadOnlySpan<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected ReadOnlySpan<char>

The expected string value.

actual ReadOnlySpan<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlySpan<char>, Span<char>)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlySpan<char> expected, Span<char> actual)

Parameters

expected ReadOnlySpan<char>

The expected string value.

actual Span<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(ReadOnlySpan<char>, Span<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(ReadOnlySpan<char> expected, Span<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected ReadOnlySpan<char>

The expected string value.

actual Span<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats spaces and tabs (in any non-zero quantity) as equivalent.

ignoreAllWhiteSpace bool

If set to true, removes all whitespaces and tabs before comparing.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Span<char>, ReadOnlySpan<char>)

Verifies that two strings are equivalent.

public static void Equal(Span<char> expected, ReadOnlySpan<char> actual)

Parameters

expected Span<char>

The expected string value.

actual ReadOnlySpan<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Span<char>, ReadOnlySpan<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(Span<char> expected, ReadOnlySpan<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected Span<char>

The expected string value.

actual ReadOnlySpan<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats spaces and tabs (in any non-zero quantity) as equivalent.

ignoreAllWhiteSpace bool

If set to true, ignores all white space differences during comparison.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Span<char>, Span<char>)

Verifies that two strings are equivalent.

public static void Equal(Span<char> expected, Span<char> actual)

Parameters

expected Span<char>

The expected string value.

actual Span<char>

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(Span<char>, Span<char>, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(Span<char> expected, Span<char> actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected Span<char>

The expected string value.

actual Span<char>

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats spaces and tabs (in any non-zero quantity) as equivalent.

ignoreAllWhiteSpace bool

If set to true, ignores all white space differences during comparison.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(string?, string?)

Verifies that two strings are equivalent.

public static void Equal(string? expected, string? actual)

Parameters

expected string

The expected string value.

actual string

The actual string value.

Examples

Add an example for this method ?

Contribution guide.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Equal(string?, string?, bool, bool, bool, bool)

Verifies that two strings are equivalent.

public static void Equal(string? expected, string? actual, bool ignoreCase = false, bool ignoreLineEndingDifferences = false, bool ignoreWhiteSpaceDifferences = false, bool ignoreAllWhiteSpace = false)

Parameters

expected string

The expected string value.

actual string

The actual string value.

ignoreCase bool

If set to true, ignores cases differences. The invariant culture is used.

ignoreLineEndingDifferences bool

If set to true, treats \r\n, \r, and \n as equivalent.

ignoreWhiteSpaceDifferences bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.

ignoreAllWhiteSpace bool

If set to true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks), including zero quantities, as equivalent.

Examples

Add an example for this method ?

Contribution guide.

Remarks

The ignoreWhiteSpaceDifferences and ignoreAllWhiteSpace flags consider the following characters to be white-space: Tab (\t), Space (\u0020), No-Break Space (\u00A0), Ogham Space Mark (\u1680), Mongolian Vowel Separator (\u180E), En Quad (\u2000), Em Quad (\u2001), En Space (\u2002), Em Space (\u2003), Three-Per-Em Space (\u2004), Four-Per-Em Space (\u2004), Six-Per-Em Space (\u2006), Figure Space (\u2007), Punctuation Space (\u2008), Thin Space (\u2009), Hair Space (\u200A), Zero Width Space (\u200B), Narrow No-Break Space (\u202F), Medium Mathematical Space (\u205F), Ideographic Space (\u3000), and Zero Width No-Break Space (\uFEFF). In particular, it does not include carriage return (\r) or line feed (\n), which are covered by ignoreLineEndingDifferences.

Exceptions

EqualException

Thrown when the strings are not equivalent.

Matches(string, string?)

Verifies that a string matches a regular expression.

public static void Matches(string expectedRegexPattern, string? actualString)

Parameters

expectedRegexPattern string

The regex pattern expected to match

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

MatchesException

Thrown when the string does not match the regex pattern

Matches(Regex, string?)

Verifies that a string matches a regular expression.

public static void Matches(Regex expectedRegex, string? actualString)

Parameters

expectedRegex Regex

The regex expected to match

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

MatchesException

Thrown when the string does not match the regex

StartsWith(Memory<char>, Memory<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(Memory<char> expectedStartString, Memory<char> actualString)

Parameters

expectedStartString Memory<char>

The sub-string expected to be at the start of the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Memory<char>, Memory<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(Memory<char> expectedStartString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString Memory<char>

The sub-string expected to be at the start of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Memory<char>, ReadOnlyMemory<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(Memory<char> expectedStartString, ReadOnlyMemory<char> actualString)

Parameters

expectedStartString Memory<char>

The sub-string expected to be at the start of the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Memory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(Memory<char> expectedStartString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString Memory<char>

The sub-string expected to be at the start of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlyMemory<char>, Memory<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(ReadOnlyMemory<char> expectedStartString, Memory<char> actualString)

Parameters

expectedStartString ReadOnlyMemory<char>

The sub-string expected to be at the start of the string

actualString Memory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlyMemory<char>, Memory<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(ReadOnlyMemory<char> expectedStartString, Memory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString ReadOnlyMemory<char>

The sub-string expected to be at the start of the string

actualString Memory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>)

Verifies that a string starts with a given sub-string, using the default StringComparison.CurrentCulture comparison type.

public static void StartsWith(ReadOnlyMemory<char> expectedStartString, ReadOnlyMemory<char> actualString)

Parameters

expectedStartString ReadOnlyMemory<char>

The sub-string expected to be at the start of the string

actualString ReadOnlyMemory<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlyMemory<char>, ReadOnlyMemory<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(ReadOnlyMemory<char> expectedStartString, ReadOnlyMemory<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString ReadOnlyMemory<char>

The sub-string expected to be at the start of the string

actualString ReadOnlyMemory<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlySpan<char>, ReadOnlySpan<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(ReadOnlySpan<char> expectedStartString, ReadOnlySpan<char> actualString)

Parameters

expectedStartString ReadOnlySpan<char>

The sub-string expected to be at the start of the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlySpan<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(ReadOnlySpan<char> expectedStartString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString ReadOnlySpan<char>

The sub-string expected to be at the start of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlySpan<char>, Span<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(ReadOnlySpan<char> expectedStartString, Span<char> actualString)

Parameters

expectedStartString ReadOnlySpan<char>

The sub-string expected to be at the start of the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(ReadOnlySpan<char>, Span<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(ReadOnlySpan<char> expectedStartString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString ReadOnlySpan<char>

The sub-string expected to be at the start of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Span<char>, ReadOnlySpan<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(Span<char> expectedStartString, ReadOnlySpan<char> actualString)

Parameters

expectedStartString Span<char>

The sub-string expected to be at the start of the string

actualString ReadOnlySpan<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Span<char>, ReadOnlySpan<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(Span<char> expectedStartString, ReadOnlySpan<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString Span<char>

The sub-string expected to be at the start of the string

actualString ReadOnlySpan<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Span<char>, Span<char>)

Verifies that a string starts with a given sub-string, using the current culture.

public static void StartsWith(Span<char> expectedStartString, Span<char> actualString)

Parameters

expectedStartString Span<char>

The sub-string expected to be at the start of the string

actualString Span<char>

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(Span<char>, Span<char>, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(Span<char> expectedStartString, Span<char> actualString, StringComparison comparisonType = StringComparison.CurrentCulture)

Parameters

expectedStartString Span<char>

The sub-string expected to be at the start of the string

actualString Span<char>

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

StartsWithException

Thrown when the string does not start with the expected sub-string

StartsWith(string?, string?)

Verifies that a string starts with a given string, using the current culture.

public static void StartsWith(string? expectedStartString, string? actualString)

Parameters

expectedStartString string

The string expected to be at the start of the string

actualString string

The string to be inspected

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string does not start with the expected sub-string

StartsWith(string?, string?, StringComparison)

Verifies that a string starts with a given sub-string, using the given comparison type.

public static void StartsWith(string? expectedStartString, string? actualString, StringComparison comparisonType)

Parameters

expectedStartString string

The sub-string expected to be at the start of the string

actualString string

The string to be inspected

comparisonType StringComparison

The type of string comparison to perform

Examples

Add an example for this method ?

Contribution guide.

Exceptions

ContainsException

Thrown when the string does not start with the expected sub-string