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
Copy file name to clipboardExpand all lines: Changelog.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres not (yet) to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [1.5] - 2024-11-12
9
+
10
+
### Added
11
+
12
+
- implementations of the newly introduced Span.Split methods from .Net 9 for any version prior to .Net 9 to maintain backwards-compatibility across .Net versions.
13
+
14
+
### Changed
15
+
16
+
- Split extension methods to refer to new split implementations compatible to the ones in .Net 9 and made .Net 9 split methods the default from that version onwards. The original split methods are still accessible as static methods.
17
+
- original Split methods are no longer available without passing span as a parameter.
/// Advances the enumerator to the next element of the collection.
70
+
/// </summary>
71
+
/// <returns><see langword="true"/> if the enumerator was successfully advanced to the next element; <see langword="false"/> if the enumerator has passed the end of the collection.</returns>
/// Returns a type that allows for enumeration of each element within a split span
55
+
/// using the provided <see cref="SpanSplitEnumerator{T}"/>.
56
+
/// </summary>
57
+
/// <typeparam name="T">The type of the elements.</typeparam>
58
+
/// <param name="source">The source span to be enumerated.</param>
59
+
/// <param name="separators">The <see cref="SpanSplitEnumerator{T}"/> to be used to split the provided span.</param>
60
+
/// <returns>Returns a <see cref="SpanSplitEnumerator{T}"/>.</returns>
61
+
/// <remarks>
62
+
/// Unlike <see cref="SplitAny{T}(ReadOnlySpan{T}, ReadOnlySpan{T})"/>, the <paramref name="separators"/> is not checked for being empty.
63
+
/// An empty <paramref name="separators"/> will result in no separators being found, regardless of the type of <typeparamref name="T"/>, whereas <see cref="SplitAny{T}(ReadOnlySpan{T}, ReadOnlySpan{T})"/> will use all Unicode whitespace characters as separators if <paramref name="separators"/> is empty and <typeparamref name="T"/> is <see cref="char"/>.
Copy file name to clipboardExpand all lines: src/Extensions/ReadOnlySpan/String/Split.cs
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ public static partial class ReadOnlySpanExtensions
13
13
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to be split.</param>
14
14
/// <param name="delimiter">An instance of <typeparamref name="T"/> that delimits the various sub-ReadOnlySpans in <paramref name="source"/>.</param>
15
15
/// <returns>An instance of the ref struct <see cref="SpanSplitEnumerator{T}"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -27,7 +27,7 @@ public static SpanSplitEnumerator<T> Split<T>(this ReadOnlySpan<T> source, T del
27
27
/// <param name="count">The maximum number of sub-ReadOnlySpans to split into.</param>
28
28
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
29
29
/// <returns>An instance of the ref struct <see cref="SpanSplitWithCountEnumerator{T}"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -39,7 +39,7 @@ public static SpanSplitWithCountEnumerator<T> Split<T>(this ReadOnlySpan<T> sour
39
39
/// <param name="delimiter">A <see cref="char"/> that delimits the various sub-ReadOnlySpans in <paramref name="source"/>.</param>
40
40
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
41
41
/// <returns>An instance of the ref struct <see cref="SpanSplitStringSplitOptionsEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -53,7 +53,7 @@ public static SpanSplitStringSplitOptionsEnumerator Split(this ReadOnlySpan<char
53
53
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
54
54
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
55
55
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyStringSplitOptionsWithCountEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
Copy file name to clipboardExpand all lines: src/Extensions/ReadOnlySpan/String/SplitAny.cs
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ public static partial class ReadOnlySpanExtensions
13
13
/// <param name="source">The <see cref="ReadOnlySpan{T}"/> to be split.</param>
14
14
/// <param name="delimiters">A <see cref="ReadOnlySpan{T}"/> with the instances of <typeparamref name="T"/> that delimit the various sub-ReadOnlySpans in <paramref name="source"/>.</param>
15
15
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyEnumerator{T}"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -27,7 +27,7 @@ public static SpanSplitAnyEnumerator<T> SplitAny<T>(this ReadOnlySpan<T> source,
27
27
/// <param name="count">The maximum number of sub-ReadOnlySpans to split into.</param>
28
28
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
29
29
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyWithCountEnumerator{T}"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -39,7 +39,7 @@ public static SpanSplitAnyWithCountEnumerator<T> SplitAny<T>(this ReadOnlySpan<T
39
39
/// <param name="delimiters">A <see cref="ReadOnlySpan{Char}"/>, that delimit the various sub-ReadOnlySpans in <paramref name="source"/>.</param>
40
40
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
41
41
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyStringSplitOptionsEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
@@ -53,7 +53,7 @@ public static SpanSplitAnyStringSplitOptionsEnumerator SplitAny(this ReadOnlySpa
53
53
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
54
54
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
55
55
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyStringSplitOptionsWithCountEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
0 commit comments