Net ToString() format documentation?

It's treating it as a Custom Numeric Format String Specifically, see the part about section separators in the linked page.

It's treating it as a Custom Numeric Format String. Specifically, see the part about section separators in the linked page: The ';' character is used to separate sections for positive, negative, and zero numbers in the format string. If there are two sections in the custom format string, the leftmost section defines the formatting of positive and zero numbers, while the rightmost section defines the formatting of negative numbers.

If there are three sections, the leftmost section defines the formatting of positive numbers, the middle section defines the formatting of negative numbers, and the rightmost section defines the formatting of zero numbers.

Take a look here and here, for official documentation. And this great cheatsheet from Jhon Sheehan's Blog!

More specifically from the mentioned cheatsheet: "; Section separator The ';' character is used to separate sections for positive, negative, and zero numbers in the format string. " – Arjan Einbu Feb 6 '09 at 17:00 Jhon Sheehan's cheatsheet is money! – Chuck Conway Feb 6 '09 at 17:19.

It's using the literal format string from the customized numeric format strings. You can supply a literal that maps onto numbes that are postive, negative, or zero numbers. The first "yes" maps to positive, the second to negative, and the "no" to zeros.

Thus any non-zero is yes, and only zeros are no. This is equivalent to standard true/false semantic interpretations on numeric values. Look under "section separator" of the Custom Numeric Format strings page.

As @Joel Coehoorn and @tvanfosson said, it's using a custom numeric format string. The reason it works is that a boolean value is convertible to a double using the following (essentially): public static double ToDouble(bool value) { return (value? ((double) 1) : ((double) 0)); } So, if value is true, it returns 1 and if value is false it returns 0.At that point, the section mapping rules apply as described by @tvanfosson (and subsequently @Joel Coehoorn).

Steve-X has the best documentation for String. Format I've seen so far: Steve-X ToString() I know you asked for "ToString", but ToString is dependent to the implementation you are calling (i.e. DateTime.ToString(), decimal.ToString...etc).

If you are really interested in how it works bust open reflector and peruse the code.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions