How to write a character in C # that represents a gender male

I am not going to concatenate some C # code id to export to a specific database. The problem is that the database uses a special character to combine identifiers. The symbol used resembles the symbol for the male gender (something like this: ♂). If I try to copy here, I only get the "0" character. I am also trying to find his ascii code, but I couldn't find it. I am getting a symbol by exporting data from a producer database of files. I want to create an array of id concatenated with this strange character in C #. For example: 12 [character] 123 [character]

+3


source to share


2 answers


When you've got the symbol somehow, just paste it into your source code:

 string m = "♂";

      

The symbol is slightly different from this: ♂. The circle is smaller and the arrow is larger



While it is possible that there are 2 variants of a character in Unicode space, the difference in appearance is likely due to different fonts.

Symbol code not known yet

Since multiple people are posted here, the code is 2642 and the notation is C # "Male(\u2642)"

or just type / paste"Male(♂)"

+1


source


Remember, ascii is what we used in the 1970s. You need Unicode code, not ascii code. If you don't understand the difference, stop whatever you are doing and read this before writing any code:

http://www.joelonsoftware.com/articles/Unicode.html



The Mars character is Unicode code number u2642, so in C # that would be

string mars = "\u2642";

      

+5


source







All Articles