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 :
Advertisement
Something interesting
Tutorials
+8.8k Golang : Check if user agent is a robot or crawler example
+4.6k How to check with curl if my website or the asset is gzipped ?
+14.4k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+7.2k Golang : Metaprogramming example of wrapping a function
+6.9k Golang : Configure Apache and NGINX to access your Go service example
+18.6k Golang : Set or Add HTTP Request Headers
+6.4k Golang : Lock executable to a specific machine with unique hash of the machine
+12.7k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+11.4k Golang : Exit, terminating or aborting a program
+11.4k Golang : "https://" not allowed in import path
+6.4k Golang : How to convert strange string to JSON with json.MarshalIndent
+11.3k Golang : How to display image file or expose CSS, JS files from localhost?