Convert a UTF8 value to Integer in R Programming – utf8ToInt() Function
Last Updated :
16 Jun, 2020
utf8ToInt()
function in R Language is used to convert a UTF8 value to an integer value.
Syntax: utf8ToInt(x, multiple)
Parameters:
x: Integer or integer vector
multiple: Boolean value to convert into single or multiple strings
Example 1:
utf8ToInt( "[" )
utf8ToInt( "+" )
utf8ToInt( ":" )
|
Output:
[1] 91
[1] 43
[1] 58
Example 2:
x1 < - c( "&@\n" )
x2 < - c( "[+:" )
x3 < - c( "1d<U>" )
utf8ToInt(x1)
utf8ToInt(x2)
utf8ToInt(x3)
|
Output:
[1] 38 64 10
[1] 91 43 58
[1] 49 100 60 85 62
Share your thoughts in the comments
Please Login to comment...