]> Cypherpunks repositories - gostls13.git/commitdiff
strings: Update Trim example.
authorRobin Eklind <r.eklind.87@gmail.com>
Mon, 16 Dec 2013 18:40:28 +0000 (10:40 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 16 Dec 2013 18:40:28 +0000 (10:40 -0800)
Use an input which better shows that behaviour of the function. Only leading
and trailing runes are trimed, not intermediate ones.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42390043

src/pkg/strings/example_test.go

index ccfc4172c39c712295492dfc079eccd4562f27cc..7350131b85fd07615ade000e5f65530340d9a4e0 100644 (file)
@@ -150,8 +150,8 @@ func ExampleToTitle() {
 }
 
 func ExampleTrim() {
-       fmt.Printf("[%q]", strings.Trim(" !!! Achtung !!! ", "! "))
-       // Output: ["Achtung"]
+       fmt.Printf("[%q]", strings.Trim(" !!! Achtung! Achtung! !!! ", "! "))
+       // Output: ["Achtung! Achtung"]
 }
 
 func ExampleMap() {