Golang strconv.IsPrint() function example

package strconv

Golang strconv.IsPrint() function usage example

 package main

 import (
  "fmt"
  "strconv"
 )

 func main() {
  ok := strconv.IsPrint('γ')

  fmt.Println("Is printable by Golang? : ", ok)

  ok = strconv.IsPrint('こ')

  fmt.Println("Is printable by Golang? : ", ok)

  ok = strconv.IsPrint('ś')

  fmt.Println("Is printable by Golang? : ", ok)

  ok = strconv.IsPrint(rune('a'))

  fmt.Println("Is printable by Golang? : ", ok)

 }

Output :

Is printable by Golang? : true

Is printable by Golang? : true

Is printable by Golang? : true

Is printable by Golang? : true

Reference :

http://golang.org/pkg/strconv/#IsPrint

Advertisement