You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Add ROSpan StartsWith and EndsWith string-like APIs with StringComparison (#26880)
* Add ROSpan StartsWith and EndsWith string-like APIs with StringComparison
* We have separate implementations of slow and fast span.
* Remove unused using directive.
* Address PR feedback and add tests.
* Add test files
* Get the string from the underlying span to avoid allocation when possible.
* Update ToString and add tests
* Update Span ToString and add tests
* Address PR feedback and disable ToString test for fast span
* Borrow additional tests from the existing StringTests test bed.
* Fix comment grammar
* No StringComparison results in generic StartsWith being called which does ordinal comparison
* Address feedback related to ToString and tests
* Fix tests for culture specific cases, for Unix.
* Fix typo in variable names
* Respond to recent change AsReadOnlySpan -> AsSpan
* Fix typo in test.
Copy file name to clipboardExpand all lines: src/System.Memory/src/System/MemoryExtensions.Fast.cs
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,24 @@ namespace System
11
11
/// </summary>
12
12
publicstaticpartialclassMemoryExtensions
13
13
{
14
+
/// <summary>
15
+
/// Determines whether the end of the <paramref name="span"/> matches the specified <paramref name="value"/> when compared using the specified <paramref name="comparisonType"/> option.
16
+
/// </summary>
17
+
/// <param name="span">The source span.</param>
18
+
/// <param name="value">The sequence to compare to the end of the source span.</param>
19
+
/// <param name="comparisonType">One of the enumeration values that determines how the <paramref name="span"/> and <paramref name="value"/> are compared.</param>
/// Determines whether the beginning of the <paramref name="span"/> matches the specified <paramref name="value"/> when compared using the specified <paramref name="comparisonType"/> option.
25
+
/// </summary>
26
+
/// <param name="span">The source span.</param>
27
+
/// <param name="value">The sequence to compare to the beginning of the source span.</param>
28
+
/// <param name="comparisonType">One of the enumeration values that determines how the <paramref name="span"/> and <paramref name="value"/> are compared.</param>
Copy file name to clipboardExpand all lines: src/System.Memory/src/System/MemoryExtensions.Portable.cs
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,42 @@ namespace System
12
12
/// </summary>
13
13
publicstaticpartialclassMemoryExtensions
14
14
{
15
+
/// <summary>
16
+
/// Determines whether the end of the <paramref name="span"/> matches the specified <paramref name="value"/> when compared using the specified <paramref name="comparisonType"/> option.
17
+
/// </summary>
18
+
/// <param name="span">The source span.</param>
19
+
/// <param name="value">The sequence to compare to the end of the source span.</param>
20
+
/// <param name="comparisonType">One of the enumeration values that determines how the <paramref name="span"/> and <paramref name="value"/> are compared.</param>
/// Determines whether the beginning of the <paramref name="span"/> matches the specified <paramref name="value"/> when compared using the specified <paramref name="comparisonType"/> option.
35
+
/// </summary>
36
+
/// <param name="span">The source span.</param>
37
+
/// <param name="value">The sequence to compare to the beginning of the source span.</param>
38
+
/// <param name="comparisonType">One of the enumeration values that determines how the <paramref name="span"/> and <paramref name="value"/> are compared.</param>
0 commit comments