Order of punctuation marks vs letters

后端 未结 3 1623
孤街浪徒
孤街浪徒 2021-01-07 03:51

In C#, it is well known that \".\".CompareTo(\"A\") == -1 .

My question is: is there a punctuation mark x such that x.CompareTo(\"A\") == 1

3条回答
  •  迷失自我
    2021-01-07 04:25

    Characters in C# are UTF-16 (16-bit characters).

    The following ASCII (i.e. found on a standard US keyboard) non-letter characters come after A:

    [ \ ] ^ _ `

    The following come after A as well as after lower-case a:

    ~ { | }

    There are also a number of other special characters above the ASCII range

    See

    http://www.fileformat.info/info/charset/UTF-16/list.htm

    http://en.wikipedia.org/wiki/UTF-16

    http://msdn.microsoft.com/en-us/library/dd374081.aspx

提交回复
热议问题