Golang unicode.IsControl() function example
package unicode
Golang unicode.IsControl() function usage example. Use to check if the input rune is a ASCII control character. See https://en.wikipedia.org/wiki/Control_character
package main
import (
"fmt"
"unicode"
)
var tab unicode.RangeTable
func main() {
control := unicode.IsControl('A')
fmt.Println("A is a control rune code ? : ", control)
control = unicode.IsControl('\f')
fmt.Println("\\f is a control rune code ? : ", control)
// see https://en.wikipedia.org/wiki/Control_character
// for the list of control characters
}
Output :
A is a control rune code ? : false
\f is a control rune code ? : true
Reference :
Advertisement
Something interesting
Tutorials
+10.9k Golang : Get UDP client IP address and differentiate clients by port number
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+5.4k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+5k Golang : micron to centimeter example
+5.4k Golang : fmt.Println prints out empty data from struct
+7.7k Golang : How to execute code at certain day, hour and minute?
+7.1k Golang : Validate credit card example
+5.8k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+22.2k Golang : Convert seconds to minutes and remainder seconds
+7.2k Golang : Check if one string(rune) is permutation of another string(rune)