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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:17:08+00:00 2026-05-11T06:17:08+00:00

true.ToString() false.toString(); Output: True False Is there a valid reason for it being True

  • 0
true.ToString()  false.toString();  Output: True False 

Is there a valid reason for it being ‘True’ and not ‘true’? It breaks when writing XML as XML’s boolean type is lower case, and also isn’t compatible with C#’s true/false (not sure about CLS though).

Update

Here is my very hacky way of getting around it in C# (for use with XML)

internal static string ToXmlString(this bool b) {     return b.ToString().ToLower(); } 

Of course that adds 1 more method to the stack, but removes ToLowers() everywhere.

  • 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. 2026-05-11T06:17:09+00:00Added an answer on May 11, 2026 at 6:17 am

    Only people from Microsoft can really answer that question. However, I’d like to offer some fun facts about it 😉

    First, this is what it says in MSDN about the Boolean.ToString() method:

    Return Value

    Type: System.String

    TrueString if the value of this instance is true, or FalseString if the value of this instance is false.

    Remarks

    This method returns the constants ‘True’ or ‘False’. Note that XML is case-sensitive, and that the XML specification recognizes ‘true’ and ‘false’ as the valid set of Boolean values. If the String object returned by the ToString() method is to be written to an XML file, its String.ToLower method should be called first to convert it to lowercase.

    Here comes the fun fact #1: it doesn’t return TrueString or FalseString at all. It uses hardcoded literals ‘True’ and ‘False’. Wouldn’t do you any good if it used the fields, because they’re marked as readonly, so there’s no changing them.

    The alternative method, Boolean.ToString(IFormatProvider) is even funnier:

    Remarks

    The provider parameter is reserved. It does not participate in the execution of this method. This means that the Boolean.ToString(IFormatProvider) method, unlike most methods with a provider parameter, does not reflect culture-specific settings.

    What’s the solution? Depends on what exactly you’re trying to do. Whatever it is, I bet it will require a hack 😉

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

Sidebar

Related Questions

Required is the true language version of the OS, not the user interface language
In other words, is there a faster, more concise way of writing the following
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _
Is it true that the only way to handle default function arguments is through
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D
when i use setDefaultLookAndFeelDecorated(true) method in Java why is the Frame appear FullScreen when
I want a true deep copy. In Java, this was easy, but how do
If this is true, I'd like to know why. Do we see a great
Is it true that the smallest amount of memory that I can allocate in
Is C# true to C++, needing a break; per case: ? .. Default is

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.