Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent Unicode character in VB.Net String literal?

Tags:

I know you can put Unicode character codes in a VB.Net string like this:

str = Chr(&H0030) & "More text" 

I would like to know how I can put the char code right into the string literal so I can use Unicode symbols from the designer view.

Is this even possible?

like image 339
CodeFusionMobile Avatar asked Jun 29 '10 19:06

CodeFusionMobile


People also ask

What is a Unicode character string?

Unicode is a standard encoding system that is used to represent characters from almost all languages. Every Unicode character is encoded using a unique integer code point between 0 and 0x10FFFF . A Unicode string is a sequence of zero or more code points.

Does string support Unicode?

Windows natively supports Unicode strings for UI elements, file names, and so forth. Unicode is the preferred character encoding, because it supports all character sets and languages. Windows represents Unicode characters using UTF-16 encoding, in which each character is encoded as one or two 16-bit values.

How do I type Unicode in Visual Studio?

In Visual Studio you can enter ALT+dddd where dddd is the four digits of the unicode character number in decimal. For example, pressing 0170 while holding down the ALT key results in entering ª.

What is an example of a Unicode character?

Unicode supports more than a million code points, which are written with a "U" followed by a plus sign and the number in hex; for example, the word "Hello" is written U+0048 U+0065 U+006C U+006C U+006F (see hex chart).


1 Answers

Use the ChrW() function to return Unicode characters.

Dim strW As String strW = ChrW(&H25B2) & "More text" 
like image 65
fivebob Avatar answered Sep 19 '22 17:09

fivebob