mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes: add IndexRune, FieldsFunc and To*Special
Basically these functions are implemented the same way as the corresponding functions in the strings package. Test functions are implemented for IndexRune and FieldsFunc. Additionally two typos are fixed in packages bytes and strings. R=r CC=golang-dev https://golang.org/cl/1696062
This commit is contained in:
parent
895c5db6df
commit
75f6a0c759
3 changed files with 83 additions and 5 deletions
|
|
@ -191,7 +191,7 @@ func Fields(s string) []string {
|
|||
return FieldsFunc(s, unicode.IsSpace)
|
||||
}
|
||||
|
||||
// FieldsFunc splits the string s at each run of Unicode code points c satifying f(c)
|
||||
// FieldsFunc splits the string s at each run of Unicode code points c satisfying f(c)
|
||||
// and returns an array of slices of s. If no code points in s satisfy f(c), an empty slice
|
||||
// is returned.
|
||||
func FieldsFunc(s string, f func(int) bool) []string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue