diff options
author | Ankit Goyal <ankit3goyal@gmail.com> | 2018-09-01 10:56:00 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-09-03 05:45:52 +0000 |
commit | 860484a15f578911e2e92b4857a2229f0a257b45 (patch) | |
tree | b7ada9b2b0e97a695c79ce7873ebffbe986b416f /src/strconv | |
parent | 317afdc3fbb477f310d9f3e9b2d8e3a381399826 (diff) | |
download | go-860484a15f578911e2e92b4857a2229f0a257b45.tar.gz go-860484a15f578911e2e92b4857a2229f0a257b45.zip |
strconv: add example for IsGraphic
Change-Id: I58ba1f5d5c942d6a345c19df1bca80b63fb5abf5
Reviewed-on: https://go-review.googlesource.com/132777
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/strconv')
-rw-r--r-- | src/strconv/example_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/strconv/example_test.go b/src/strconv/example_test.go index 5c2e8a9b56..15725456e2 100644 --- a/src/strconv/example_test.go +++ b/src/strconv/example_test.go @@ -167,6 +167,22 @@ func ExampleFormatUint() { // string, 2a } +func ExampleIsGraphic() { + shamrock := strconv.IsGraphic('☘') + fmt.Println(shamrock) + + a := strconv.IsGraphic('a') + fmt.Println(a) + + bel := strconv.IsGraphic('\007') + fmt.Println(bel) + + // Output: + // true + // true + // false +} + func ExampleIsPrint() { c := strconv.IsPrint('\u263a') fmt.Println(c) |