473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to print special character in C#?

I want to print a string value that represent temperature.
how to print the 'little superscript circle' in C#?
thx...
Nov 15 '05 #1
10 55726
Amuro wrote:
I want to print a string value that represent temperature.
how to print the 'little superscript circle' in C#?


Example:

Console.WriteLine("\x00B0");

HTH,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #2
using System;
using System.Collections;

public class MyClass
{
public static void Main()
{
Console.WriteLine("Hello, World! \u00b0");
Console.ReadLine();
}
}

--
/jop
"Amuro" <am***@hotmail.com> wrote in message
news:e4**************@tk2msftngp13.phx.gbl...
I want to print a string value that represent temperature.
how to print the 'little superscript circle' in C#?
thx...

Nov 15 '05 #3
Well ALT+176 worked in some programs but not in most. You could always
copy/paste from this -> ° <- For use with °C or °F. There are also unicode
characters that are prebuilt with the degree symbol.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #4
Amuro <am***@hotmail.com> wrote:
I want to print a string value that represent temperature.
how to print the 'little superscript circle' in C#?


The principle is the same as for all characters: find the Unicode
character on unicode.org, and then embed it appropriately in your code
(eg using a \uxxxx escape sequence).

http://www.unicode.org/charts/charindex.html is a good starting point -
but you do need to have a reasonable idea of the name of the character.
In this case, I would search for "degree" which actually finds (at
least) 4 characters:

Degree celsius: 2103
Degree fahrenheit: 2109
Degree kelvin: 212a
Degree sign: 00b0

Of course, they may well all be represented by the same glyph.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #5
Jon Skeet wrote:
The principle is the same as for all characters: find the Unicode
character on unicode.org, and then embed it appropriately in your code
(eg using a \uxxxx escape sequence).


Or you're starting 'charmap' and look it up in the status bar.

Best regards,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #6
> Degree celsius: 2103
Degree fahrenheit: 2109
Degree kelvin: 212a
Degree sign: 00b0


Except, there is no such thing as degree kelvin, just kelvin. ;) But
that's another story.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #7
Morten Wennevik wrote:
Except, there is no such thing as degree kelvin, just kelvin. ;) But
that's another story.


Yeah, right. :) Most people don't know this.

Best regards,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #8
Michael Kremser <us****************@aon.at> wrote:
Except, there is no such thing as degree kelvin, just kelvin. ;) But
that's another story.


Yeah, right. :) Most people don't know this.


Including the folks at the Unicode Consortium, by the looks of it :)

(On the other hand, it's probably the simplest way of registering the
name so that people will find it.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #9
Jon Skeet wrote:
Except, there is no such thing as degree kelvin, just kelvin. ;) But
that's another story.


Yeah, right. :) Most people don't know this.

Including the folks at the Unicode Consortium, by the looks of it :)


Yes, which is questionable. You couldn't say "meter degree" or "pound
degree" as well, that'd be the same nonsense.

Best regards,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #10
Thx all!

"Amuro" <am***@hotmail.com> wrote in message
news:e4**************@tk2msftngp13.phx.gbl...
I want to print a string value that represent temperature.
how to print the 'little superscript circle' in C#?
thx...

Nov 15 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ozer | last post by:
Hi friends, I wanna ask something. I use javascript menu on my user interface. And the js files contains special(turkish) character. I need to use codepage=1254 attribute in my @Page tag. If i...
2
by: weetat.yeo | last post by:
Hi all , I have a form that allow user to enter description , sometimes the description value have html special character for example %20 and etc. Inserting into the mysql database is ok , for...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
3
by: jeyabarani | last post by:
Hi guys, I want to check whether the user has entered any special characters in a text box. If the user enters, i want to display an alert message stating that he cant enter a special character...
1
kaleeswaran
by: kaleeswaran | last post by:
Hi! i am handling password generation module..... i need to force the user enter the special character in their password thing.so i need to handle the special character.so...
1
by: Ragavendran | last post by:
Hi, I am using this method for search: Query =org.apache.lucene.queryParser.QueryParser.parse(String arg0) throws ParseException Hits = org.apache.lucene.search.Searcher.search(Query query,...
6
vekipeki
by: vekipeki | last post by:
I am having a problem with basic drawing of unicode characters in Windows 2000 and XP. I have written a simplest possible C# WinForms program to test it (just create a new Windows Forms C#...
3
by: thesti | last post by:
hi, how to search a string in a table that contain a special character ? for example i want to search fo a string "D'Crepes" in a field of a table. i've tried using the following sql from vb...
1
by: dinesh1985singh | last post by:
Hello Everyone, In my database I found few special character,these special character were get stored even after using proper function for striping out these character,like mysql_real_escape...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.