diff --git a/src/libraries/System.Private.CoreLib/src/System/Char.cs b/src/libraries/System.Private.CoreLib/src/System/Char.cs
index 6b7d11bda27386..e8ee0692a82d32 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Char.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Char.cs
@@ -129,16 +129,22 @@ public bool Equals(char obj)
return m_value == obj;
}
- internal bool Equals(char right, StringComparison comparisonType)
+ ///
+ /// Returns a value that indicates whether the current instance and a specified character are equal using the specified comparison option.
+ ///
+ /// The character to compare with the current instance.
+ /// One of the enumeration values that specifies the rules to use in the comparison.
+ /// if the current instance and are equal; otherwise, .
+ public bool Equals(char other, StringComparison comparisonType)
{
switch (comparisonType)
{
case StringComparison.Ordinal:
- return Equals(right);
+ return Equals(other);
default:
- ReadOnlySpan leftCharsSlice = [this];
- ReadOnlySpan rightCharsSlice = [right];
- return leftCharsSlice.Equals(rightCharsSlice, comparisonType);
+ ReadOnlySpan thisCharsSlice = [this];
+ ReadOnlySpan otherCharsSlice = [other];
+ return thisCharsSlice.Equals(otherCharsSlice, comparisonType);
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
index cf8e536c5fded1..c97347cdecc89c 100644
--- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
@@ -1464,6 +1464,10 @@ internal static bool NonPackedContainsValueType(ref T searchSpace, T value, i
internal static int IndexOfChar(ref char searchSpace, char value, int length)
=> IndexOfValueType(ref Unsafe.As(ref searchSpace), (short)value, length);
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ internal static int LastIndexOfChar(ref char searchSpace, char value, int length)
+ => LastIndexOfValueType(ref Unsafe.As(ref searchSpace), (short)value, length);
+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static int NonPackedIndexOfChar(ref char searchSpace, char value, int length) =>
NonPackedIndexOfValueType>(ref Unsafe.As(ref searchSpace), (short)value, length);
@@ -1655,6 +1659,10 @@ internal static int NonPackedIndexOfValueType(ref TValue searc
internal static int IndexOfAnyChar(ref char searchSpace, char value0, char value1, int length)
=> IndexOfAnyValueType(ref Unsafe.As(ref searchSpace), (short)value0, (short)value1, length);
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ internal static int LastIndexOfAnyChar(ref char searchSpace, char value0, char value1, int length)
+ => LastIndexOfAnyValueType(ref Unsafe.As(ref searchSpace), (short)value0, (short)value1, length);
+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static int IndexOfAnyValueType(ref T searchSpace, T value0, T value1, int length) where T : struct, INumber
=> IndexOfAnyValueType>(ref searchSpace, value0, value1, length);
diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
index 11e1e950f9d973..f2218eb276603b 100644
--- a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs
@@ -76,34 +76,84 @@ public int IndexOf(char value, int startIndex)
}
public int IndexOf(char value, StringComparison comparisonType)
+ {
+ return IndexOf(value, 0, comparisonType);
+ }
+
+ ///
+ /// Reports the zero-based index of the first occurrence of the specified character in the current String object.
+ /// Parameters specify the starting search position in the current string and the type of search to use for
+ /// the specified character.
+ ///
+ /// The character to seek.
+ /// The search starting position.
+ /// One of the enumeration values that specifies the rules for the search.
+ ///
+ /// The zero-based index position of from the start of the current instance
+ /// if that character is found, or a negative value (e.g. -1) if it is not.
+ ///
+ public int IndexOf(char value, int startIndex, StringComparison comparisonType)
+ {
+ return IndexOf(value, startIndex, Length - startIndex, comparisonType);
+ }
+
+ ///
+ /// Reports the zero-based index of the first occurrence of the specified character in the current String object.
+ /// Parameters specify the starting search position in the current string, the number of characters in the
+ /// current string to search, and the type of search to use for the specified character.
+ ///
+ /// The character to seek.
+ /// The search starting position.
+ /// The number of character positions to examine.
+ /// One of the enumeration values that specifies the rules for the search.
+ ///
+ /// The zero-based index position of from the start of the current instance
+ /// if that character is found, or a negative value (e.g. -1) if it is not.
+ ///
+ public int IndexOf(char value, int startIndex, int count, StringComparison comparisonType)
{
return comparisonType switch
{
- StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, GetCaseCompareOfComparisonCulture(comparisonType)),
- StringComparison.InvariantCulture or StringComparison.InvariantCultureIgnoreCase => CompareInfo.Invariant.IndexOf(this, value, GetCaseCompareOfComparisonCulture(comparisonType)),
- StringComparison.Ordinal => IndexOf(value),
- StringComparison.OrdinalIgnoreCase => IndexOfCharOrdinalIgnoreCase(value),
+ StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
+ StringComparison.InvariantCulture or StringComparison.InvariantCultureIgnoreCase => CompareInfo.Invariant.IndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
+ StringComparison.Ordinal => IndexOf(value, startIndex, count),
+ StringComparison.OrdinalIgnoreCase => IndexOfCharOrdinalIgnoreCase(value, startIndex, count),
_ => throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)),
};
}
- private int IndexOfCharOrdinalIgnoreCase(char value)
+ private int IndexOfCharOrdinalIgnoreCase(char value, int startIndex, int count)
{
- if (!char.IsAscii(value))
+ ArgumentOutOfRangeException.ThrowIfNegative(startIndex);
+ ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, Length);
+ ArgumentOutOfRangeException.ThrowIfNegative(count);
+ ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex + count, Length);
+
+ int subIndex;
+
+ if (char.IsAscii(value))
{
- return Ordinal.IndexOfOrdinalIgnoreCase(this, new ReadOnlySpan(in value));
+ ref char startChar = ref Unsafe.Add(ref _firstChar, startIndex);
+
+ if (char.IsAsciiLetter(value))
+ {
+ char valueLc = (char)(value | 0x20);
+ char valueUc = (char)(value & ~0x20);
+ subIndex = PackedSpanHelpers.PackedIndexOfIsSupported
+ ? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref startChar, valueLc, count)
+ : SpanHelpers.IndexOfAnyChar(ref startChar, valueLc, valueUc, count);
+ }
+ else
+ {
+ subIndex = SpanHelpers.IndexOfChar(ref startChar, value, count);
+ }
}
-
- if (char.IsAsciiLetter(value))
+ else
{
- char valueLc = (char)(value | 0x20);
- char valueUc = (char)(value & ~0x20);
- return PackedSpanHelpers.PackedIndexOfIsSupported
- ? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref _firstChar, valueLc, Length)
- : SpanHelpers.IndexOfAnyChar(ref _firstChar, valueLc, valueUc, Length);
+ subIndex = Ordinal.IndexOfOrdinalIgnoreCase(this.AsSpan(startIndex, count), new ReadOnlySpan(in value));
}
- return SpanHelpers.IndexOfChar(ref _firstChar, value, Length);
+ return subIndex < 0 ? subIndex : startIndex + subIndex;
}
public int IndexOf(char value, int startIndex, int count)
@@ -291,7 +341,7 @@ public int IndexOf(string value, int startIndex, int count, StringComparison com
/// The rune to seek.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int IndexOf(Rune value)
{
@@ -306,7 +356,7 @@ public int IndexOf(Rune value)
/// The search starting position.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int IndexOf(Rune value, int startIndex)
{
@@ -323,7 +373,7 @@ public int IndexOf(Rune value, int startIndex)
/// The number of character positions to examine.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int IndexOf(Rune value, int startIndex, int count)
{
@@ -338,7 +388,7 @@ public int IndexOf(Rune value, int startIndex, int count)
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int IndexOf(Rune value, StringComparison comparisonType)
{
@@ -355,9 +405,9 @@ public int IndexOf(Rune value, StringComparison comparisonType)
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
- internal int IndexOf(Rune value, int startIndex, StringComparison comparisonType)
+ public int IndexOf(Rune value, int startIndex, StringComparison comparisonType)
{
return IndexOf(value, startIndex, Length - startIndex, comparisonType);
}
@@ -373,9 +423,9 @@ internal int IndexOf(Rune value, int startIndex, StringComparison comparisonType
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the start of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
- internal int IndexOf(Rune value, int startIndex, int count, StringComparison comparisonType)
+ public int IndexOf(Rune value, int startIndex, int count, StringComparison comparisonType)
{
ArgumentOutOfRangeException.ThrowIfLessThan(startIndex, 0);
ArgumentOutOfRangeException.ThrowIfLessThan(count, 0);
@@ -384,7 +434,7 @@ internal int IndexOf(Rune value, int startIndex, int count, StringComparison com
// Convert value to span
ReadOnlySpan valueChars = value.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]);
- int subIndex = this.AsSpan(startIndex..(startIndex + count)).IndexOf(valueChars, comparisonType);
+ int subIndex = this.AsSpan(startIndex, count).IndexOf(valueChars, comparisonType);
return subIndex < 0 ? subIndex : startIndex + subIndex;
}
@@ -423,6 +473,107 @@ public int LastIndexOf(char value, int startIndex, int count)
return result < 0 ? result : result + startSearchAt;
}
+ ///
+ /// Reports the zero-based index of the last occurrence of the specified character in the current String object.
+ /// A parameter specifies the type of search to use for the specified character.
+ ///
+ /// The character to seek.
+ /// One of the enumeration values that specifies the rules for the search.
+ ///
+ /// The zero-based index position of from the end of the current instance
+ /// if that character is found, or a negative value (e.g. -1) if it is not.
+ ///
+ public int LastIndexOf(char value, StringComparison comparisonType)
+ {
+ return LastIndexOf(value, Length - 1, comparisonType);
+ }
+
+ ///
+ /// Reports the zero-based index of the last occurrence of the specified character in the current String object.
+ /// Parameters specify the starting search position in the current string and the type of search to use for
+ /// the specified character.
+ ///
+ /// The character to seek.
+ /// The search starting position. The search proceeds from toward the beginning of this instance.
+ /// One of the enumeration values that specifies the rules for the search.
+ ///
+ /// The zero-based index position of from the end of the current instance
+ /// if that character is found, or a negative value (e.g. -1) if it is not.
+ ///
+ public int LastIndexOf(char value, int startIndex, StringComparison comparisonType)
+ {
+ return LastIndexOf(value, startIndex, startIndex + 1, comparisonType);
+ }
+
+ ///
+ /// Reports the zero-based index of the last occurrence of the specified character in the current String object.
+ /// Parameters specify the starting search position in the current string, the number of characters in the
+ /// current string to search, and the type of search to use for the specified character.
+ ///
+ /// The character to seek.
+ /// The search starting position. The search proceeds from toward the beginning of this instance.
+ /// The number of character positions to examine.
+ /// One of the enumeration values that specifies the rules for the search.
+ ///
+ /// The zero-based index position of from the end of the current instance
+ /// if that character is found, or a negative value (e.g. -1) if it is not.
+ ///
+ public int LastIndexOf(char value, int startIndex, int count, StringComparison comparisonType)
+ {
+ if (Length == 0)
+ {
+ return -1;
+ }
+
+ return comparisonType switch
+ {
+ StringComparison.CurrentCulture or StringComparison.CurrentCultureIgnoreCase => CultureInfo.CurrentCulture.CompareInfo.LastIndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
+ StringComparison.InvariantCulture or StringComparison.InvariantCultureIgnoreCase => CompareInfo.Invariant.LastIndexOf(this, value, startIndex, count, GetCaseCompareOfComparisonCulture(comparisonType)),
+ StringComparison.Ordinal => LastIndexOf(value, startIndex, count),
+ StringComparison.OrdinalIgnoreCase => LastIndexOfCharOrdinalIgnoreCase(value, startIndex, count),
+ _ => throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)),
+ };
+ }
+
+ private int LastIndexOfCharOrdinalIgnoreCase(char value, int startIndex, int count)
+ {
+ int startSearchAt = startIndex + 1 - count;
+
+ ArgumentOutOfRangeException.ThrowIfNegative(startIndex);
+ ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, Length);
+ ArgumentOutOfRangeException.ThrowIfNegative(count);
+ ArgumentOutOfRangeException.ThrowIfNegative(startSearchAt);
+
+ int subIndex;
+
+ if (char.IsAscii(value))
+ {
+ ref char startChar = ref Unsafe.Add(ref _firstChar, startSearchAt);
+
+ if (char.IsAsciiLetter(value))
+ {
+ char valueLc = (char)(value | 0x20);
+ char valueUc = (char)(value & ~0x20);
+ /*
+ * Potential optimization possible here if there was a
+ * PackedSpanHelpers.LastIndexOfAnyIgnoreCase(ref startChar, valueLc, count)
+ * method, which would be complex to implement
+ */
+ subIndex = SpanHelpers.LastIndexOfAnyChar(ref startChar, valueLc, valueUc, count);
+ }
+ else
+ {
+ subIndex = SpanHelpers.LastIndexOfChar(ref startChar, value, count);
+ }
+ }
+ else
+ {
+ subIndex = Ordinal.LastIndexOfOrdinalIgnoreCase(this.AsSpan(startSearchAt, count), new ReadOnlySpan(in value));
+ }
+
+ return subIndex < 0 ? subIndex : startSearchAt + subIndex;
+ }
+
// Returns the index of the last occurrence of any specified character in the current instance.
// The search starts at startIndex and runs backwards to startIndex - count + 1.
// The character at position startIndex is included in the search. startIndex is the larger
@@ -519,7 +670,7 @@ public int LastIndexOf(string value, int startIndex, int count, StringComparison
/// The rune to seek.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int LastIndexOf(Rune value)
{
@@ -534,7 +685,7 @@ public int LastIndexOf(Rune value)
/// The search starting position. The search proceeds from toward the beginning of this instance.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int LastIndexOf(Rune value, int startIndex)
{
@@ -551,7 +702,7 @@ public int LastIndexOf(Rune value, int startIndex)
/// The number of character positions to examine.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int LastIndexOf(Rune value, int startIndex, int count)
{
@@ -566,7 +717,7 @@ public int LastIndexOf(Rune value, int startIndex, int count)
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
public int LastIndexOf(Rune value, StringComparison comparisonType)
{
@@ -583,9 +734,9 @@ public int LastIndexOf(Rune value, StringComparison comparisonType)
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
- internal int LastIndexOf(Rune value, int startIndex, StringComparison comparisonType)
+ public int LastIndexOf(Rune value, int startIndex, StringComparison comparisonType)
{
return LastIndexOf(value, startIndex, startIndex + 1, comparisonType);
}
@@ -601,21 +752,26 @@ internal int LastIndexOf(Rune value, int startIndex, StringComparison comparison
/// One of the enumeration values that specifies the rules for the search.
///
/// The zero-based index position of from the end of the current instance
- /// if that rune is found, or -1 if it is not.
+ /// if that rune is found, or a negative value (e.g. -1) if it is not.
///
- internal int LastIndexOf(Rune value, int startIndex, int count, StringComparison comparisonType)
+ public int LastIndexOf(Rune value, int startIndex, int count, StringComparison comparisonType)
{
+ if (Length == 0)
+ {
+ return -1;
+ }
+
ArgumentOutOfRangeException.ThrowIfLessThan(startIndex, 0);
ArgumentOutOfRangeException.ThrowIfLessThan(count, 0);
ArgumentOutOfRangeException.ThrowIfLessThan(startIndex - count + 1, 0);
- ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, Length - 1);
+ ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, Length);
// Convert value to span
ReadOnlySpan valueChars = value.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]);
int startIndexFromZero = startIndex - count + 1;
- int subIndex = this.AsSpan(startIndexFromZero..(startIndexFromZero + count)).LastIndexOf(valueChars, comparisonType);
+ int subIndex = this.AsSpan(startIndexFromZero, count).LastIndexOf(valueChars, comparisonType);
return subIndex < 0 ? subIndex : startIndexFromZero + subIndex;
}
}
diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs
index 6869aeb397ceb0..fd7d1260f388d0 100644
--- a/src/libraries/System.Runtime/ref/System.Runtime.cs
+++ b/src/libraries/System.Runtime/ref/System.Runtime.cs
@@ -1089,6 +1089,7 @@ public CannotUnloadAppDomainException(string? message, System.Exception? innerEx
public static int ConvertToUtf32(char highSurrogate, char lowSurrogate) { throw null; }
public static int ConvertToUtf32(string s, int index) { throw null; }
public bool Equals(char obj) { throw null; }
+ public bool Equals(char other, System.StringComparison comparisonType) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static double GetNumericValue(char c) { throw null; }
@@ -5706,6 +5707,8 @@ public void CopyTo(System.Span destination) { }
public int IndexOf(char value, int startIndex) { throw null; }
public int IndexOf(char value, int startIndex, int count) { throw null; }
public int IndexOf(char value, System.StringComparison comparisonType) { throw null; }
+ public int IndexOf(char value, int startIndex, System.StringComparison comparisonType) { throw null; }
+ public int IndexOf(char value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int IndexOf(string value) { throw null; }
public int IndexOf(string value, int startIndex) { throw null; }
public int IndexOf(string value, int startIndex, int count) { throw null; }
@@ -5716,6 +5719,8 @@ public void CopyTo(System.Span destination) { }
public int IndexOf(System.Text.Rune value, int startIndex) { throw null; }
public int IndexOf(System.Text.Rune value, int startIndex, int count) { throw null; }
public int IndexOf(System.Text.Rune value, System.StringComparison comparisonType) { throw null; }
+ public int IndexOf(System.Text.Rune value, int startIndex, System.StringComparison comparisonType) { throw null; }
+ public int IndexOf(System.Text.Rune value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int IndexOfAny(char[] anyOf) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
@@ -5742,6 +5747,9 @@ public void CopyTo(System.Span destination) { }
public int LastIndexOf(char value) { throw null; }
public int LastIndexOf(char value, int startIndex) { throw null; }
public int LastIndexOf(char value, int startIndex, int count) { throw null; }
+ public int LastIndexOf(char value, System.StringComparison comparisonType) { throw null; }
+ public int LastIndexOf(char value, int startIndex, System.StringComparison comparisonType) { throw null; }
+ public int LastIndexOf(char value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int LastIndexOf(string value) { throw null; }
public int LastIndexOf(string value, int startIndex) { throw null; }
public int LastIndexOf(string value, int startIndex, int count) { throw null; }
@@ -5752,6 +5760,8 @@ public void CopyTo(System.Span destination) { }
public int LastIndexOf(System.Text.Rune value, int startIndex) { throw null; }
public int LastIndexOf(System.Text.Rune value, int startIndex, int count) { throw null; }
public int LastIndexOf(System.Text.Rune value, System.StringComparison comparisonType) { throw null; }
+ public int LastIndexOf(System.Text.Rune value, int startIndex, System.StringComparison comparisonType) { throw null; }
+ public int LastIndexOf(System.Text.Rune value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int LastIndexOfAny(char[] anyOf) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/CharTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/CharTests.cs
index 65112375551d3f..77854eed48bb30 100644
--- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/CharTests.cs
+++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/CharTests.cs
@@ -147,21 +147,71 @@ public static void ConvertToUtf32_Char_Char_Invalid()
AssertExtensions.Throws("highSurrogate", () => char.ConvertToUtf32('\u0000', '\u0000')); // Non-surrogate, non-surrogate
}
+ public static IEnumerable