Standard library / unicode

unicode.IsDigit()

Tests Unicode decimal digits (Nd), not every numeric character. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func IsDigit(r rune) bool

Parameters & Attributes

NameTypeDescription
rruneUnicode code point.

Return Value

bool

Tests Unicode decimal digits (Nd), not every numeric character.

Working Example

Example Snippetgo
package main
import (  "fmt"  "unicode")
func main() {  fmt.Println(unicode.IsDigit('۳'))}
Go Reference