Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does .ToUpper() work?

Tags:

c#

.net

I'm just curoius how does .ToUpper() work? Is there a some sort of mapping that a lower a have UTF code XYZ and the upper has UTF code XYZ1?

like image 507
Simon Edström Avatar asked Jul 12 '12 11:07

Simon Edström


People also ask

How does toupper function work?

The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts a lowercase alphabet to an uppercase alphabet. It is defined in the ctype.

How does toupper work in C++?

Explanation: toupper accepts a character as an argument (it actually accepts an integer, but the two are interchangeable) and will convert it to uppercase, and will return the uppercase character, in the form of an ASCII integer, and leave the parameter unchanged.

What does toupper mean in R?

Convert string from lowercase to uppercase in R programming – toupper() function.

How do I use char toupper?

To convert a character to uppercase by using the casing conventions of the current culture, call the ToUpper(Char, CultureInfo) method overload with a value of CurrentCulture for its culture parameter.


1 Answers

Yes, it's making use of the Unicode metadata. Every character (Unicode code point) has a case as well as case mapping to upper- and lowercase (and title case). .NET uses this information to convert a string to upper- or lowercase. You can find the very same information in the Unicode Character Database.

like image 167
Joey Avatar answered Oct 28 '22 07:10

Joey