strings, bytes: add CutPrefix and CutSuffix

Fixes #42537

Change-Id: Ie03c2614ffee30ebe707acad6b9f6c28fb134a45
Reviewed-on: https://go-review.googlesource.com/c/go/+/407176
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Changkun Ou <mail@changkun.de>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Changkun Ou 2022-05-19 11:57:50 +02:00 committed by Robert Griesemer
parent 0df7ad2e79
commit 68005592b3
5 changed files with 136 additions and 0 deletions

4
api/next/42537.txt Normal file
View file

@ -0,0 +1,4 @@
pkg bytes, func CutPrefix([]uint8, []uint8) ([]uint8, bool) #42537
pkg bytes, func CutSuffix([]uint8, []uint8) ([]uint8, bool) #42537
pkg strings, func CutPrefix(string, string) (string, bool) #42537
pkg strings, func CutSuffix(string, string) (string, bool) #42537