-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bytes, strings: add Lines, SplitSeq, SplitAfterSeq, FieldsSeq, Fields…
…FuncSeq Fixes golang#61901.
- Loading branch information
Showing
8 changed files
with
422 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pkg bytes, func FieldsFuncSeq([]uint8, func(int32) bool) iter.Seq[[]uint8] #61901 | ||
pkg bytes, func FieldsSeq([]uint8) iter.Seq[[]uint8] #61901 | ||
pkg bytes, func Lines([]uint8) iter.Seq[[]uint8] #61901 | ||
pkg bytes, func SplitAfterSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901 | ||
pkg bytes, func SplitSeq([]uint8, []uint8) iter.Seq[[]uint8] #61901 | ||
pkg strings, func FieldsFuncSeq(string, func(int32) bool) iter.Seq[string] #61901 | ||
pkg strings, func FieldsSeq(string) iter.Seq[string] #61901 | ||
pkg strings, func Lines(string) iter.Seq[string] #61901 | ||
pkg strings, func SplitAfterSeq(string, string) iter.Seq[string] #61901 | ||
pkg strings, func SplitSeq(string, string) iter.Seq[string] #61901 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### Iterators | ||
|
||
The new [iter] package provides the basic definitions for working with | ||
user-defined iterators. | ||
|
||
The [bytes] package adds several functions that work with iterators: | ||
- [Lines](/pkg/bytes#Lines) returns an iterator over the | ||
newline-terminated lines in the byte slice s. | ||
- [SplitSeq](/pkg/bytes#SplitSeq) returns an iterator over | ||
all substrings of s separated by sep. | ||
- [SplitAfterSeq](/pkg/bytes#SplitAfterSeq) returns an iterator | ||
over substrings of s split after each instance of sep. | ||
- [FieldsSeq](/pkg/bytes#FieldsSeq) returns an iterator over | ||
substrings of s split around runs of whitespace characters, | ||
as defined by unicode.IsSpace. | ||
- [FieldsFuncSeq](/pkg/bytes#FieldsFuncSeq) returns an iterator | ||
over substrings of s split around runs of Unicode code points satisfying f(c). | ||
|
||
The [strings] package adds several functions that work with iterators: | ||
- [Lines](/pkg/strings#Lines) returns an iterator over | ||
the newline-terminated lines in the string s. | ||
- [SplitSeq](/pkg/strings#SplitSeq) returns an iterator over | ||
all substrings of s separated by sep. | ||
- [SplitAfterSeq](/pkg/strings#SplitAfterSeq) returns an iterator | ||
over substrings of s split after each instance of sep. | ||
- [FieldsSeq](/pkg/strings#FieldsSeq) returns an iterator over | ||
substrings of s split around runs of whitespace characters, | ||
as defined by unicode.IsSpace. | ||
- [FieldsFuncSeq](/pkg/strings#FieldsFuncSeq) returns an iterator | ||
over substrings of s split around runs of Unicode code points satisfying f(c). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- see ../../3-iter.md --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- see ../../3-iter.md --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.