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
+8.2k Golang : How to get garbage collection data?
+8.1k Golang : Play .WAV file from command line
+7.9k Golang : What is the default port number for connecting to MySQL/MariaDB database ?
+21.6k Golang : Strings to lowercase and uppercase example
+6.4k Golang : Lock executable to a specific machine with unique hash of the machine
+17.9k Golang : Get current URL example
+10.5k Linux : How to install driver for 600Mbps Dual Band Wifi USB Adapter
+9k Android Studio : Simple input textbox and intercept key example
+19.8k Golang : Encrypt and decrypt data with TripleDES
+15.6k Golang : Capture stdout of a child process and act according to the result
+11.3k Swift : Convert (cast) Int or int32 value to CGFloat
+4.4k Golang : If else example and common mistake