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
expectedSubstringMemory<char>The sub-string expected to be in the string
actualStringMemory<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
expectedSubstringMemory<char>The sub-string expected to be in the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringMemory<char>The sub-string expected to be in the string
actualStringReadOnlyMemory<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
expectedSubstringMemory<char>The sub-string expected to be in the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlyMemory<char>The sub-string expected to be in the string
actualStringMemory<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
expectedSubstringReadOnlyMemory<char>The sub-string expected to be in the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlyMemory<char>The sub-string expected to be in the string
actualStringReadOnlyMemory<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
expectedSubstringReadOnlyMemory<char>The sub-string expected to be in the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlySpan<char>The string expected to be in the string
actualStringReadOnlySpan<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
expectedSubstringReadOnlySpan<char>The string expected to be in the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlySpan<char>The string expected to be in the string
actualStringSpan<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
expectedSubstringReadOnlySpan<char>The string expected to be in the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringSpan<char>The string expected to be in the string
actualStringReadOnlySpan<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
expectedSubstringSpan<char>The string expected to be in the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringSpan<char>The string expected to be in the string
actualStringSpan<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
expectedSubstringSpan<char>The string expected to be in the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringstringThe sub-string expected to be in the string
actualStringstringThe 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
expectedSubstringstringThe sub-string expected to be in the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringMemory<char>The sub-string expected not to be in the string
actualStringMemory<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
expectedSubstringMemory<char>The sub-string expected not to be in the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringMemory<char>The sub-string expected not to be in the string
actualStringReadOnlyMemory<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
expectedSubstringMemory<char>The sub-string expected not to be in the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlyMemory<char>The sub-string expected not to be in the string
actualStringMemory<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
expectedSubstringReadOnlyMemory<char>The sub-string expected not to be in the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlyMemory<char>The sub-string expected not to be in the string
actualStringReadOnlyMemory<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
expectedSubstringReadOnlyMemory<char>The sub-string expected not to be in the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlySpan<char>The sub-string expected not to be in the string
actualStringReadOnlySpan<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
expectedSubstringReadOnlySpan<char>The sub-string expected not to be in the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringReadOnlySpan<char>The sub-string expected not to be in the string
actualStringSpan<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
expectedSubstringReadOnlySpan<char>The sub-string expected not to be in the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringSpan<char>The sub-string expected not to be in the string
actualStringReadOnlySpan<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
expectedSubstringSpan<char>The sub-string expected not to be in the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringSpan<char>The sub-string expected not to be in the string
actualStringSpan<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
expectedSubstringSpan<char>The sub-string expected not to be in the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedSubstringstringThe sub-string expected not to be in the string
actualStringstringThe 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
expectedSubstringstringThe sub-string expected not to be in the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe 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
expectedRegexPatternstringThe regex pattern expected not to match
actualStringstringThe 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
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
valuestringThe 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
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<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
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<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
expectedEndStringMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<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
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<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
expectedEndStringReadOnlyMemory<char>The sub-string expected to be at the end of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<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
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringSpan<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
expectedEndStringReadOnlySpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<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
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringSpan<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
expectedEndStringSpan<char>The sub-string expected to be at the end of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedEndStringstringThe sub-string expected to be at the end of the string
actualStringstringThe 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
expectedEndStringstringThe sub-string expected to be at the end of the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe 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
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
expectedMemory<char>The expected string value.
actualMemory<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedMemory<char>The expected string value.
actualReadOnlyMemory<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
expectedMemory<char>The expected string value.
actualReadOnlyMemory<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedReadOnlyMemory<char>The expected string value.
actualMemory<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
expectedReadOnlyMemory<char>The expected string value.
actualMemory<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedReadOnlyMemory<char>The expected string value.
actualReadOnlyMemory<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
expectedReadOnlyMemory<char>The expected string value.
actualReadOnlyMemory<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedReadOnlySpan<char>The expected string value.
actualReadOnlySpan<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
expectedReadOnlySpan<char>The expected string value.
actualReadOnlySpan<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedReadOnlySpan<char>The expected string value.
actualSpan<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
expectedReadOnlySpan<char>The expected string value.
actualSpan<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats spaces and tabs (in any non-zero quantity) as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedSpan<char>The expected string value.
actualReadOnlySpan<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
expectedSpan<char>The expected string value.
actualReadOnlySpan<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats spaces and tabs (in any non-zero quantity) as equivalent.ignoreAllWhiteSpaceboolIf 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
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
expectedSpan<char>The expected string value.
actualSpan<char>The actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats spaces and tabs (in any non-zero quantity) as equivalent.ignoreAllWhiteSpaceboolIf 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
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
expectedstringThe expected string value.
actualstringThe actual string value.
ignoreCaseboolIf set to
true, ignores cases differences. The invariant culture is used.ignoreLineEndingDifferencesboolIf set to
true, treats \r\n, \r, and \n as equivalent.ignoreWhiteSpaceDifferencesboolIf set to
true, treats horizontal white-space (i.e. spaces, tabs, and others; see remarks) in any non-zero quantity as equivalent.ignoreAllWhiteSpaceboolIf 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
expectedRegexPatternstringThe regex pattern expected to match
actualStringstringThe 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
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
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<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
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<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
expectedStartStringMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<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
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<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
expectedStartStringReadOnlyMemory<char>The sub-string expected to be at the start of the string
actualStringReadOnlyMemory<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<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
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringSpan<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
expectedStartStringReadOnlySpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<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
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringReadOnlySpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringSpan<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
expectedStartStringSpan<char>The sub-string expected to be at the start of the string
actualStringSpan<char>The string to be inspected
comparisonTypeStringComparisonThe 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
expectedStartStringstringThe string expected to be at the start of the string
actualStringstringThe 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
expectedStartStringstringThe sub-string expected to be at the start of the string
actualStringstringThe string to be inspected
comparisonTypeStringComparisonThe 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