O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required