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 8840271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:25:41+00:00 2026-06-14T10:25:41+00:00

So I was in a middle of converting string to hex value represenation and

  • 0

So I was in a middle of converting string to hex value represenation and By mistake instead of writing
ToString("X0")

I wrote

ToString("X100")

var t="123";
for (int i=0;i<t.Length;i++)
{
     Console.WriteLine( ((int)t[i]).ToString("X100"));
}

the values were :

X149
X150
X151

p.s. :

ToString("X10") yields :

0000000031
0000000032
0000000033

ToString("X99") yields : ( same with many zeros)

but when jumping like 100 , 1000 , 10000…. it yields somwthing with X

what is this X representation ? X149 for example…?

  • 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-06-14T10:25:43+00:00Added an answer on June 14, 2026 at 10:25 am

    For the x and X format specifiers, as with all of the standard numeric formats, you can only request up to 99 digits. Once you try to ask for more than that, you no longer have a standard format specifier, but a custom one.

    In a custom format specifier, ‘0’ means to include a digit in the original number, and everything else is kept as a constant.

    So:

    19.ToString("X8") = "00000013"
    19.ToString("X99") = "0000...0013" // 99 digits
    19.ToString("X100") = "X119"; // "X1" + 19.ToString("00")
    19.ToString("X101") = "X1191" // "X1" + 19.ToString("0") + "1"
    29.ToString("X1010") = "X1219" // "X1" + 2.ToString("0") + "1" + 9.ToString("0")
    

    etc.

    (To explain that last one: each 0 represents the next digit in the number being formatted; the first 0 was replaced by a 2, the second 0 was replaced by a 9. These get really tricky really fast.)

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

Sidebar

Related Questions

I'm in the middle of writing my own version of the Windows Loader (albeit
My company is in the middle of converting from CVS over to git. We've
I am in the middle of converting a listview example into a program that
I'm in the middle of converting a 10-year-old Java EE application to more modern
In the middle of converting VB6 code to VB.NET, I need to replace the
We are in a middle of an migration process of converting EJB2.1 entity beans
I was in the middle of writing up a long description of what I
I am in the middle of converting over our build system from Ant to
I'm in the middle of converting some code from C++/CLI to C#. One of
Middle-tier component will execute the data access routines in application. The component will call

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.