mirror of https://github.com/golang/go.git
fmt: add example for Sprint
Updates #27376 Change-Id: I9ce6541a95b5ecd13f3932558427de1f597df07a Reviewed-on: https://go-review.googlesource.com/134036 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
b7182acf61
commit
7bee8085da
|
|
@ -122,3 +122,12 @@ func ExampleFscanln() {
|
|||
// 3: dmr, 1771, 1.618034
|
||||
// 3: ken, 271828, 3.141590
|
||||
}
|
||||
|
||||
func ExampleSprint() {
|
||||
s := fmt.Sprint("there", "are", "99", "gophers")
|
||||
fmt.Println(s)
|
||||
fmt.Println(len(s))
|
||||
// Output:
|
||||
// thereare99gophers
|
||||
// 17
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue