I’m having a senior moment with converting unicode literals to strings. I know that I can get a string via &u.
dim s as string = &u0308
gives me the umlaut of for an . But how do I convert this if I have the 0308 as local variable? The following code doesn’t give a result:
dim i as Integer = Val("&u0308")
dim s as String = Chr(i)
Dim i As Integer = Val("&h" + “0308”)
Dim s As String = Encodings.UTF8.Chr(i)
Or:
dim i as Integer = Asc(&u0308)
dim s as String = Chr(i)
@Peter : thanks, this works. But why do I need to use &h and not 0u???
From Documentation:
Val recognizes prefixes &o (octal), &b (binary), and &h (hexadecimal).
Rick_A
(Rick A)
April 28, 2014, 2:34pm
6
&h n returns a numeric constant. &u n returns a string constant.
Currently, Val only evaluates strings resulting in numeric value returned as a Double number.