]> Cypherpunks repositories - gostls13.git/commit
Add IndexFunc and LastIndexFunc.
authorRoger Peppe <rogpeppe@gmail.com>
Mon, 14 Jun 2010 21:54:48 +0000 (14:54 -0700)
committerRob Pike <r@golang.org>
Mon, 14 Jun 2010 21:54:48 +0000 (14:54 -0700)
commit18274e007598436e62182c72c3103bf94a8feade
tree4b6d2e8dd877088e3501784ef9706ed37de14322
parentb9055629c191deab9c4dffc0d0b5f8fb31687e1d
Add IndexFunc and LastIndexFunc.
Change TrimRight and TrimLeft to use these functions.
Incidentally fix minor bug in TrimRight.
Add some test cases for this.
YMMV whether it's worth saving the closure allocation.

R=r, r2
CC=golang-dev, hoisie, rsc
https://golang.org/cl/1198044
src/pkg/strings/strings.go
src/pkg/strings/strings_test.go