Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C#

Displaying Greek letters in .NET using char casting

Rate me:
Please Sign up or sign in to vote.
2.28/5 (10 votes)
4 Sep 2006CPOL 30.9K   9   5
How to display Greek letters in .NET using char casting.

Introduction

I searched the Internet one day looking for a way to add that wily "Omega" symbol to some code of mine. I turns out that the best way to do this is to simply cast the hexcode value for "omega" to type char and add it anywhere in the string where you want it to appear. I thought I would share this information here with those of you who may need it.

A very simple example of this would look like the following:

C#
aString  = aString + (char)0x03A9;
return aString;

This can be pretty much done for any symbol that has a hexcode! I hope this helps someone...Always share knowledge!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionresponse.write greek characters c# Pin
Member 1342042520-Sep-17 9:36
Member 1342042520-Sep-17 9:36 
GeneralUnicode as an alternative Pin
Chris Danezis25-Jul-08 10:16
Chris Danezis25-Jul-08 10:16 
GeneralJust what I needed. Pin
Rick Pingry24-Jul-07 14:59
Rick Pingry24-Jul-07 14:59 
GeneralRe: Just what I needed. Pin
Stelios_8121-May-08 21:45
Stelios_8121-May-08 21:45 
GeneralRe: Just what I needed. Pin
Rick Pingry7-Jun-08 6:54
Rick Pingry7-Jun-08 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.