mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes,strings: add available godoc link
Change-Id: Id9706a783d3321e3706eeee102286522e7968efd Reviewed-on: https://go-review.googlesource.com/c/go/+/534775 Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
a0da9c00ae
commit
6dd7462a04
6 changed files with 61 additions and 61 deletions
|
|
@ -272,7 +272,7 @@ func genSplit(s, sep string, sepSave, n int) []string {
|
|||
// n < 0: all substrings
|
||||
//
|
||||
// Edge cases for s and sep (for example, empty strings) are handled
|
||||
// as described in the documentation for Split.
|
||||
// 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) }
|
||||
|
|
@ -301,7 +301,7 @@ func SplitAfterN(s, sep string, n int) []string {
|
|||
// If sep is empty, Split splits after each UTF-8 sequence. If both s
|
||||
// and sep are empty, Split returns an empty slice.
|
||||
//
|
||||
// It is equivalent to SplitN with a count of -1.
|
||||
// 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) }
|
||||
|
|
@ -315,7 +315,7 @@ func Split(s, sep string) []string { return genSplit(s, sep, 0, -1) }
|
|||
// If sep is empty, SplitAfter splits after each UTF-8 sequence. If
|
||||
// both s and sep are empty, SplitAfter returns an empty slice.
|
||||
//
|
||||
// It is equivalent to SplitAfterN with a count of -1.
|
||||
// It is equivalent to [SplitAfterN] with a count of -1.
|
||||
func SplitAfter(s, sep string) []string {
|
||||
return genSplit(s, sep, len(sep), -1)
|
||||
}
|
||||
|
|
@ -904,7 +904,7 @@ func Trim(s, cutset string) string {
|
|||
// TrimLeft returns a slice of the string s with all leading
|
||||
// Unicode code points contained in cutset removed.
|
||||
//
|
||||
// To remove a prefix, use TrimPrefix instead.
|
||||
// To remove a prefix, use [TrimPrefix] instead.
|
||||
func TrimLeft(s, cutset string) string {
|
||||
if s == "" || cutset == "" {
|
||||
return s
|
||||
|
|
@ -952,7 +952,7 @@ func trimLeftUnicode(s, cutset string) string {
|
|||
// TrimRight returns a slice of the string s, with all trailing
|
||||
// Unicode code points contained in cutset removed.
|
||||
//
|
||||
// To remove a suffix, use TrimSuffix instead.
|
||||
// To remove a suffix, use [TrimSuffix] instead.
|
||||
func TrimRight(s, cutset string) string {
|
||||
if s == "" || cutset == "" {
|
||||
return s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue