Golang unicode.Is() function example
package unicode
Golang unicode.Is() function usage example.
package main
import (
"fmt"
"unicode"
)
func main() {
memberShip := unicode.Is(unicode.Greek, 'Ө')
fmt.Println("Ө(theta) is in the range of unicode.Greek range table ? : ", memberShip)
memberShip = unicode.Is(unicode.Han, '世')
fmt.Println("世 is in the range of unicode.Han range table ? : ", memberShip)
}
Sample output :
Ө(theta) is in the range of unicode.Greek range table ? : false
世 is in the range of unicode.Han range table ? : true
Advertisement
Something interesting
Tutorials
+8.6k Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
+12.6k Golang : Get absolute path to binary for os.Exec function with exec.LookPath
+13.6k Golang : Set image canvas or background to transparent
+8.4k Golang : Generate Datamatrix barcode
+20.1k Golang : Convert seconds to human readable time format example
+23.5k Golang : Get ASCII code from a key press(cross-platform) example
+8.5k Golang : How to check variable or object type during runtime?
+15.2k JavaScript/JQuery : Detect or intercept enter key pressed example
+19.9k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+6k Linux/MacOSX : Search for files by filename and extension with find command
+14.7k Golang : Get URI segments by number and assign as variable example
+7.3k Golang : How to iterate a slice without using for loop?