]> Cypherpunks repositories - gostls13.git/commitdiff
strconv: add example for IsGraphic
authorAnkit Goyal <ankit3goyal@gmail.com>
Sat, 1 Sep 2018 17:56:00 +0000 (10:56 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Sep 2018 05:45:52 +0000 (05:45 +0000)
Change-Id: I58ba1f5d5c942d6a345c19df1bca80b63fb5abf5
Reviewed-on: https://go-review.googlesource.com/132777
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/strconv/example_test.go

index 5c2e8a9b5608b22c7977df185ed44ef731efa5ba..15725456e26339c05406588c0c404fa42cfd5289 100644 (file)
@@ -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)