Insert a Special Character in a String

Problem

You need to use an extended character that can’t be entered using the keyboard.

Solution

Determine the character code for the special character (possibly using the Character Map utility [charmap.exe]), and convert the number into the special character using the ToChar shared method of the System.Convert class.

Discussion

To insert a special character, you must first determine its Unicode character number. One useful tool that helps is Character Map, which is included with all versions of Windows. Using Character Map, you can select a font, browse to a specific character in its character set, and determine the character code. Figure 1-1 shows an example with the copyright symbol selected.

Figure 1-1. Using ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.