diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-16 06:54:42 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-16 06:54:42 +0000 |
commit | f4ca453c9530ff24478cae090c9979b97fdd7411 (patch) | |
tree | 0e8fda573576bb4181dba29d0e88380a8c38fafd /libgo/go/strings/example_test.go | |
parent | 84a4a7d4b2fecf754bc0b7fce55b05912a054ef4 (diff) | |
download | ppe42-gcc-f4ca453c9530ff24478cae090c9979b97fdd7411.tar.gz ppe42-gcc-f4ca453c9530ff24478cae090c9979b97fdd7411.zip |
libgo: Update to Go 1.1.1.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/strings/example_test.go')
-rw-r--r-- | libgo/go/strings/example_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/go/strings/example_test.go b/libgo/go/strings/example_test.go index 733caf5f2db..36e0a42fb03 100644 --- a/libgo/go/strings/example_test.go +++ b/libgo/go/strings/example_test.go @@ -179,3 +179,19 @@ func ExampleToLower() { fmt.Println(strings.ToLower("Gopher")) // Output: gopher } + +func ExampleTrimSuffix() { + var s = "Hello, goodbye, etc!" + s = strings.TrimSuffix(s, "goodbye, etc!") + s = strings.TrimSuffix(s, "planet") + fmt.Print(s, "world!") + // Output: Hello, world! +} + +func ExampleTrimPrefix() { + var s = "Goodbye,, world!" + s = strings.TrimPrefix(s, "Goodbye,") + s = strings.TrimPrefix(s, "Howdy,") + fmt.Print("Hello" + s) + // Output: Hello, world! +} |