Top "Tostring" questions

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

Dumping a java object's properties

Is there a library that will recursively dump/print an objects properties? I'm looking for something similar to the console.…

java reflection properties dump tostring
ToString on null string

Why does the second one of these produce an exception while the first one doesn't? string s = null; MessageBox.Show(…

c# string exception null tostring
Join an array by a comma and a space

I have an array that I want converted to a comma delimited string. Array.toString() works, but if I have …

javascript arrays string tostring
c# Decimal to string for currency

To display a currency we do: ToString("0.##") For value 5.00 the output is: 5 For value 5.98 the output is: 5.98 For value 5.90 the …

c# decimal currency tostring
What to import to use IOUtils.toString()?

I am trying to use IOUtils.toString() to read from a file. However, I am getting an error saying "IOUtils …

java apache io tostring
What is the Objective-C equivalent for "toString()", for use with NSLog?

Is there a method that I can override in my custom classes so that when NSLog(@"%@", myObject) is called, it …

objective-c tostring nslog
Java: Getting the properties of a class to construct a string representation

Let's say I have a class like this (and also further assume that all the private variables: public class Item { …

java reflection class tostring class-variables
TypeScript override ToString()

Let's say I have a class Person which looks like this: class Person { constructor( public firstName: string, public lastName: string, …

javascript typescript overriding tostring
C# int ToString format on 2 char int?

How do I use the ToString method on an integer to display a 2-char int i = 1; i.ToString() -> "01" …

c# tostring
How convert TimeSpan to 24 hours and minutes String?

I use this code for converting Timespan to String (for ex: 14:53) : myTimeSpan.ToString("hh:mm"); but this error occurs: Input …

c# tostring timespan