Top "Tostring" questions

"toString" or "ToString" is a major formatting method or function used in high level programming languages.

Explicit vs implicit call of toString

I used to use the implicit call of toString when wanting some debug info about an object, because in case …

java tostring
Using string representations of enum values in switch-case

Why is it not possible to use enum values as strings in a switch case? (Or what is wrong with …

java enums switch-statement case tostring
Java: Printing out an object for debugging

I would like an easy way to print out a java object, or to say it another way, serialize an …

java json tostring infinity divide-by-zero
Javascript object get code as string

First off, I am sorry if this is a duplicate, but every time I googled for 'object' and 'code' I …

javascript object tostring
String.Format vs ToString()

Can anyone explain if there is any benefit in either one of the following methods: decimal d = 12.0m; // 1. how I'd …

c# tostring string.format
AttributeError: type object 'ElementTree' has no attribute 'tostring'

I have this problem , AttributeError: type object 'ElementTree' has no attribute 'tostring', I don't know what's is wrong, I import …

xml python-2.7 tostring elementtree
BigInteger to Hex/Decimal/Octal/Binary strings?

In Java, I could do BigInteger b = new BigInteger(500); Then format it as I pleased b.toString(2); //binary b.toString(8); //…

c# tostring biginteger
Converting Range or DocumentFragment to string

Is there a way to get the html string of a JavaScript Range Object in W3C compliant browsers? For …

javascript selection range tostring documentfragment
How to make JSON.Net serializer to call ToString() when serializing a particular type?

I am using Newtonsoft.Json serializer to convert C# classes to JSON. For some classes I don't need the serializer …

c# json serialization json.net tostring
toString() method within System.out.println() a double call?

A professor of mine once said that the following code should never be done: System.out.println(object.toString()); He …

java printing double call tostring