aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/strings
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-02-18 13:10:34 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-18 13:12:08 -0800
commit20a33efdf32bf0aedcb0c9813ddc7572bb1ab8c7 (patch)
tree94aec72c2092a11fa49f0b45da8e036f13416209 /libgo/go/strings
parent1931cbad498e625b1e24452dcfffe02539b12224 (diff)
downloadgcc-20a33efdf32bf0aedcb0c9813ddc7572bb1ab8c7.zip
gcc-20a33efdf32bf0aedcb0c9813ddc7572bb1ab8c7.tar.gz
gcc-20a33efdf32bf0aedcb0c9813ddc7572bb1ab8c7.tar.bz2
libgo: update to Go1.18rc1 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/386594
Diffstat (limited to 'libgo/go/strings')
-rw-r--r--libgo/go/strings/strings.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/strings/strings.go b/libgo/go/strings/strings.go
index c5a29e9..5793d9e 100644
--- a/libgo/go/strings/strings.go
+++ b/libgo/go/strings/strings.go
@@ -270,6 +270,8 @@ func genSplit(s, sep string, sepSave, n int) []string {
//
// Edge cases for s and sep (for example, empty strings) are handled
// as described in the documentation for Split.
+//
+// To split around the first instance of a separator, see Cut.
func SplitN(s, sep string, n int) []string { return genSplit(s, sep, 0, n) }
// SplitAfterN slices s into substrings after each instance of sep and
@@ -296,6 +298,8 @@ func SplitAfterN(s, sep string, n int) []string {
// and sep are empty, Split returns an empty slice.
//
// It is equivalent to SplitN with a count of -1.
+//
+// To split around the first instance of a separator, see Cut.
func Split(s, sep string) []string { return genSplit(s, sep, 0, -1) }
// SplitAfter slices s into all substrings after each instance of sep and