当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


GO IsGraphic用法及代码示例

GO语言"strconv"包中"IsGraphic"函数的用法及代码示例。

用法:

func IsGraphic(r rune) bool

IsGraphic 报告符文是否被 Unicode 定义为图形。此类字符包括 L、M、N、P、S 和 Zs 类别中的字母、标记、数字、标点符号和空格。

例子:

package main

import (
    "fmt"
    "strconv"
)

func main() {
    shamrock := strconv.IsGraphic('☘')
    fmt.Println(shamrock)

    a := strconv.IsGraphic('a')
    fmt.Println(a)

    bel := strconv.IsGraphic('\007')
    fmt.Println(bel)

}

输出:

true
true
false

相关用法


注:本文由纯净天空筛选整理自golang.google.cn大神的英文原创作品 IsGraphic。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。