Top "String-formatting" questions

Commonly refers to a number of methods to display an arbitrary number of varied data types into a string.

Output in a table format in Java's System.out

I'm getting results from a database and want to output the data as a table in Java's standard output I've …

java string-formatting tabular
How to format strings in Java

Primitive question, but how do I format strings like this: "Step {1} of {2}" by substituting variables using Java? In C# it's …

java string string-formatting
Format a Go string without printing?

Is there a simple way to format a string in Go without printing the string? I can do: bar := "bar" …

string go formatting string-formatting
Using Python String Formatting with Lists

I construct a string s in Python 2.6.5 which will have a varying number of %s tokens, which match the number …

python string list formatting string-formatting
php Replacing multiple spaces with a single space

I'm trying to replace multiple spaces with a single space. When I use ereg_replace, I get an error about …

php regex formatting string-formatting ereg-replace
How to format number of decimal places in wpf using style/template?

I am writing a WPF program and I am trying to figure out a way to format data in a …

wpf xaml data-binding string-formatting
Use StringFormat to add a string to a WPF XAML binding

I have a WPF 4 application that contains a TextBlock which has a one-way binding to an integer value (in this …

c# wpf xaml data-binding string-formatting
Named placeholders in string formatting

In Python, when formatting string, I can fill placeholders by name rather than by position, like that: print "There's an …

java string-formatting
Using variables inside strings

In PHP I can do the following: $name = 'John'; $var = "Hello {$name}"; // => Hello John Is there a similar language …

c# string string-formatting
How are booleans formatted in Strings in Python?

I see I can't do: "%b %b" % (True, False) in Python. I guessed %b for b(oolean). Is there something …

python boolean string-formatting