Have you ever had this problem that you need to type some special symbols in Visual Studio .NET text editor? Such as ©
, ®
, ±
, à
, À
, and the list goes on. Of course, if you are working on an ASPX file, you can always use the HTML editor and type in their HTML names or HTML numbers, and Visual Studio .NET will automatically convert them to those special symbols (VS 2005 does a much better job than VS 2003). But what if it is not an ASPX file so you don’t have the HTML editor option? For example, you need to change the copyright information of the assembly in AssemblyInfo.vb or AssemblyInfo.cs as the following screen shot shows:
How will you insert the copyright symbol in VS text editor? If you type “& copy;” which is the HTML name for ©
, the text editor will not convert it, you will have “Copyright & copy; Two Tech Hippos” , instead of “Copyright ©
Two Tech Hippos”. So how can you then type special characters in VS text editor?
Well, you can always use MS Word and insert a special character, then copy & paste it into the VS text editor. But I don’t think it is the best way. There gotta be another way to do it.
After searching the Internet for a couple of days, I finally found the trick: hold you ALT key, then type in the desired HTML number from you numpad, once you release the ALT key, the special character is converted automatically. For example, to enter the copyright symbol, hold the ALT key, then type number 0, 1, 6, 9 in the order from the numpad, and once you release the ALT key, the special character will be inserted into the place. A nice trick, isn’t it?
Here is a complete list of the HTML codes. With the trick above and the HTML codes, you can type any special characters in the VS text editor.
Please let me know if this small trick helped you.
Sorry for the confusion. The WP text editor automatically converted “& copy;” to
©
in my article, which caused the confusion. I edited the article, and it should make more sense now.Basically the article shows how to enter special characters in VS.NET text editor when you are working on a .cs or .vb file.
Thanks. Exactly what I needed. It is a little silly that you can't just open the table as in Word, but I suppose this is the "professional" way of doing it, right? So it will help me to learn the necessary HTML codes.
Thanks again. Perfect.
This was very useful, I needed to put in some non=english characters for a customer and couldn't remember how.
Thanks!
Nice trick. Unfortunately it does not appear to work with extended characters. For example, the Greek letter beta is 03B2, but if I hold down the ALT key and try to type that, it opens the menu that has ALT-B as its shortcut.
Hi Kevin, this trick only works for the symbols that have numeric HTML codes because you will need to use the small numpad to type in the numbers. Since the Greek letter beta has ‘B’ in its HTML code and you cannot enter it from numpad, this trick will not work. You will have to find the letter either on-line or in MS Word, then copy it and paste it in the VS text editor.