Golang unicode.In() function example
package unicode
Golang unicode.In() function usage example. Use to check if a given rune is from within ranges of RangeTable.
package main
import (
"fmt"
"unicode"
)
var tab unicode.RangeTable
func main() {
memberShip := unicode.In('A', &tab)
fmt.Println("A is a member of tab ? : ", memberShip)
memberShip = unicode.In('界', unicode.Han)
fmt.Println("界 is a member of unicode.Han ? : ", memberShip)
}
Output :
A is a member of tab ? : false
界 is a member of unicode.Han ? : true
References :
Advertisement
Something interesting
Tutorials
+5k Golang : Function as an argument type example
+4.4k Javascript : How to loop over and parse JSON data?
+10.2k Golang : Simple file scaning and remove virus example
+8.2k Golang : How to get garbage collection data?
+9.6k Golang : Command line file upload program to server example
+19.3k Golang : Convert PNG transparent background image to JPG or JPEG image
+12.1k Golang : reCAPTCHA example
+9.6k Golang : Replace a parameter's value inside a configuration file example
+15.3k Golang : read gzipped http response
+5.6k Golang : Skip or discard items of non-interest when iterating example
+21k Golang : Repeat a character by multiple of x factor