Using subscript character in C# code?

Leonard

Considering that the C# compiler should be able to handle Unicode characters, I'm curious to know why the subscript character doesn't seem to work? It'd be nice to use it in conjunction with Linq, I think (pseudo-code):

collection.Sort((x₀, x₁) => x₁.CompareTo(x₀));
CodeCaster

Because subscript characters aren't in the allowed character classes, basically.

See C# language specification, 2.4.2 Identifiers for the rules. Digits in an identifier must be of the Unicode class "Nd", or "Number, decimal digit".

See Unicode Character 'SUBSCRIPT ONE' (U+2081) for the information on this particular character:

Category                    Number, Other [No]

Character.isDigit()         No
Character.isLetter()        No
Character.isLetterOrDigit() No

This also means that however you compare it, a subscript 1 != the digit 1.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Using subscript character in C# code?

From Dev

Converting character code to character C# using CultureInfo

From Dev

Unicode character with subscript

From Dev

superscript and subscript the same character in an expression

From Dev

Using % as subscript in plotmath

From Dev

"Array Subscript is not an integer" c

From Dev

subscript operator in C++

From Dev

"Array Subscript is not an integer" c

From Dev

Using qsort for character array in C

From Dev

Setting subscript and superscript for specific character in the TextView?

From Dev

subscript format the last character in a string in jquery

From Dev

Subscript Out of Range Error in Code

From Dev

Replace a character in a string using assembly code in MASM

From Dev

Insert symbol into a cell using closedxml and character code

From Dev

Swift / transferring objective c code / iterate in for loop / Type XY has no subscript members

From Dev

Six-bit character code in C#

From Dev

How to refer to a Chinese character in C code

From Dev

C get unicode code point for character

From Dev

Subscript out of bounds when using [[]]

From Dev

Using Greek letters with dynamic subscript

From Dev

Using Subscript and Superscript in Processing 2?

From Dev

Error using subscript of optional array

From Dev

C# Create a subscript in a string

From Dev

"Array subscript is not an integer" in C program

From Dev

C++ subscript [] operator overloading

From Dev

C++ Vector Subscript of of range

From Dev

How to input a character in character array using loop in C?

From Dev

How to input a character in character array using loop in C?

From Dev

How to read character by character in text file line using C#

Related Related

HotTag

Archive