Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7568791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:00:44+00:00 2026-05-30T15:00:44+00:00

In C#, it is well known that ..CompareTo(A) == -1 . My question is:

  • 0

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 (strangely I can’t find the answer anywhere)

or in other terms, what is the complete default order for strings in C# ?

I know I can define Comparers and Comparisons, but I am asking this question because I am using a class that I cannot modify and that performs a default alphabetical sort on a List of strings.

My problem is that I need to put some dummy values at the end of the list and I would rather have something like:

"value 1"
"value 2"
"_"
"_"
"_"

than

"value 1"
"value 2"
"zzz"
"zzz"
"zzz"

EDIT:

This is not great but I will use (char)738

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:00:45+00:00Added an answer on May 30, 2026 at 3:00 pm

    You should simply use character with code you like (i.e. character '\uffcc' or string "\uffcc") as sentinel as long as you don’t need to make it printable.

    Character comparison uses Unicode (UTF-16) character codes. So look at Unicode table to find some like:

    ‘A’ < ‘{‘ or ‘A’ < ‘¡’.

    String comparison: there are no “<” and “>” operators in String class. You need to use Compare method. Usually you use StringComparer class to pick what type of comparison you want case sensitive, culture aware or just by Unicode values.

    Unicode type of characters impact default comparison used by CompareTo (when not using compare ordinal). Character with category “OtherLetter” is greater than character with category “OtherSymbol” or “OtherPunctuation” (Char.GetUnicodeCategory). See CompareOptions.StringSort for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Its a well known fact that a static method can work only on static
I find that many high level functions are missing in most well-known javascript libraries
Salve! Part of another question/answer on SO (as well as other statements claiming the
I do realize that this question seems very well known, but since I don't
It is well-known that monoids are stunningly ubiquitous in programing. They are so ubiquitous
It's a well known problem that executing make test doesn't build the tests as
It's a well known fact, that Oracle treats empty strings as null. However, I'm
Is there a well-known, portable, good library for C++ process management? I found a
It seems to be well-known there is a bug when using JMenuItem.getRootPane(). I read
Is there any well-known algorithm (or obvious solution) for transforming a list from order

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.