About 20,900,000 results
Open links in new tab
  1. How can I format a number into a string with leading zeros?

    I have a number that I need to convert to a string. First I used this: Key = i.ToString(); But I realize it's being sorted in a strange order and so I need to pad it with zeros. How could I do this?

  2. How to format a DateTime in PowerShell - Stack Overflow

    I REALLY wish the the -Format parameter would simply change the default behavior of a particular DateTime object's ToString method. Then it would work as you had expected.

  3. .net - Convert Enum to String - Stack Overflow

    Which is the preferred way to convert an Enum to a String? Enum.GetName Enum.Format ToString ?? Why should I prefer one of these over the others? Does one perform better?

  4. How to use the toString method in Java? - Stack Overflow

    Sep 1, 2010 · The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal …

  5. How can I format a nullable DateTime with ToString ()?

    6 You can use dt2.Value.ToString("format"), but of course that requires that dt2 != null, and that negates th use of a nullable type in the first place. There are several solutions here, but the big question is: …

  6. How do I display a decimal value to 2 decimal places?

    When displaying the value of a decimal currently with .ToString(), it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 dec...

  7. c# - Format decimal for percentage values? - Stack Overflow

    String.Format("Value: {0:%%}.", 0.8526) Where %% is that format provider or whatever I am looking for. Should result: Value: %85.26.. I basically need it for wpf binding, but first let's solve the general …

  8. string - C# Double - ToString () formatting with two decimal places but ...

    C# Double - ToString () formatting with two decimal places but no rounding Asked 15 years, 8 months ago Modified 4 years, 3 months ago Viewed 576k times

  9. .net - Convert a list to a string in C# - Stack Overflow

    The .ToString() method for reference types usually resolves back to System.Object.ToString() unless you override it in a derived type (possibly using extension methods for the built-in types).

  10. xml - Convert Python ElementTree to string - Stack Overflow

    Explanation ElementTree.tostring() returns a bytestring by default in Python 2 & 3. This is an issue because Python 3 switched to using Unicode for strings. In Python 2 you could use the str type for …