Main Content

hex

Convert UTF-32 representation to hexadecimal values

    Description

    example

    hexStr= hex(str32)converts the UTF-32 representationstr32to hexadecimal values.

    Examples

    collapse all

    Convert the string"Hello! "to its Unicode UTF-32 string representation using thetextanalytics.unicode.UTF32function.

    str ="Hello! "; str32 = textanalytics.unicode.UTF32(str)
    str32 = UTF32 with properties: Data: [72 101 108 108 111 33 32 128512]

    Convertstr32to hexadecimal values using thehexfunction.

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

    Input Arguments

    collapse all

    UTF-32 string representation, specified as aUTF32array.

    Output Arguments

    collapse all

    Hexadecimal values, returned as a string array.

    The outputhexStris a string array with the same size asstr32, wherehexStr(i)is a string containing the hexadecimal values corresponding to thestr32(i)separated by whitespace characters.

    Version History

    Introduced in R2021a