Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode章节建议增加汉字range #31

Open
rongyi opened this issue Apr 26, 2017 · 0 comments
Open

unicode章节建议增加汉字range #31

rongyi opened this issue Apr 26, 2017 · 0 comments

Comments

@rongyi
Copy link

rongyi commented Apr 26, 2017

在unicode package中定义了各种字符的range,比如unicode.Han则代表了所有中文字符的range,还有个方法提供判断一个字符是不是落在某个区间。具体可以参考下面的一个示例。

package main

import (
	"unicode"
	"fmt"
)

func main() {
	fmt.Println(unicode.In('C', unicode.Han))
	fmt.Println(unicode.In('具', unicode.Han))
}

output:
false
true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant