主要内容

textanalytics.unicode.UTF32

Unicode UTF-32字符串表示

    描述

    32位Unicode转换格式(UTF-32)是一种固定长度的Unicode码点编码,每个码点使用32位。

    创建

    描述

    例子

    str32= textanalytics.unicode.UTF32 (str的Unicode UTF-32表示形式str.如果str是数组吗str32(我)是否Unicode UTF-32表示的字符串str(我)

    输入参数

    全部展开

    输入文本,指定为字符串数组、字符向量或字符向量的单元格数组。

    例子:[“一个短句的例子。”“第二个简短的句子。”]

    数据类型:字符串|字符|细胞

    属性

    全部展开

    UTF-32代码点,指定为具有类型的整数向量uint32

    如果输入字符串包含代理对,则对应的代码点列表具有不同的长度。

    数据类型:uint32

    对象的功能

    characterCategories Unicode字符类别
    十六进制 将UTF-32表示转换为十六进制值
    字符串 将UTF-32表示转换为字符串

    例子

    全部折叠

    转换字符串“你好!”的Unicode UTF-32字符串表示形式textanalytics.unicode.UTF32函数。

    str =“你好!”;str32 = textanalysis .unicode. utf32 (str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    转换字符串“你好!”的Unicode UTF-32字符串表示形式textanalytics.unicode.UTF32函数。

    str =“你好!”;str32 = textanalysis .unicode. utf32 (str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    的Unicode字符类别str32使用characterCategories函数。

    ucats = characterCategories(str32)
    ucats =1x1单元阵列{[l l l l l p z s]}

    Unicode字符类别“L”、“P”、“Z”和“S”分别对应“字母”、“标点符号”、“分隔符”和“符号”。

    转换字符串“你好!”的Unicode UTF-32字符串表示形式textanalytics.unicode.UTF32函数。

    str =“你好!”;str32 = textanalysis .unicode. utf32 (str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    的Unicode字符类别str32使用characterCategories函数。要返回详细的Unicode字符类别,请设置“粒度”选项“详细”

    ucats = characterCategories(str32,“粒度”“详细”
    ucats =1x1单元阵列{[路Ll Ll Ll Ll Po Zs So]}

    Unicode字符类别“Lu”、“Ll”、“Po”、“Zs”和“So”分别对应“大写字母”、“小写字母”、“其他标点符号”、“空格分隔符”和“其他符号”。

    转换字符串“你好!”的Unicode UTF-32字符串表示形式textanalytics.unicode.UTF32函数。

    str =“你好!”;str32 = textanalysis .unicode. utf32 (str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    转换str32的十六进制值十六进制函数。

    hexStr = hex(str32)
    hexStr = " 0048 0065 006C 006C 006F 0021 0020 1F600"

    转换字符串“你好!”的Unicode UTF-32字符串表示形式textanalytics.unicode.UTF32函数。

    str =“你好!”;str32 = textanalysis .unicode. utf32 (str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    转换str32使用字符串函数。

    STR = string(str32)
    str = "你好! "

    参考文献

    [1]Unicode标准附件#19 UTF-32https://www.unicode.org/reports/tr19/tr19-9.html

    版本历史

    在R2021a中引入