Top "String-formatting" questions

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

Python 3.2: How to pass a dictionary into str.format()

I've been reading the Python 3.2 docs about string formatting but it hasn't really helped me with this particular problem. Here …

python-3.x dictionary string-formatting keyword-argument
WPF DataGrid cell string format as a style or template

I tried several ways to factor out the format of a cell in a WPF DataGrid (the one provided with .…

wpf datagrid datagridtemplatecolumn string-formatting datagridtextcolumn
Preventing decimals with NSNumberFormatter

I have an NSNumberFormatter which I'm trying to use to generate a whole number of GBP (£) from an NSNumber. I …

ios string-formatting nsnumberformatter
String.Format() - Repassing params but adding more parameters

I would like to do something like that: public string GetMessage(params object otherValues[]) { return String.Format(this.Message, this.…

c# .net string-formatting params-keyword
How do I customize output of a custom type using printf?

I've read through a good chunk of Expert F# and am working on building an actual application. While debugging, I've …

f# printf string-formatting f#-interactive
Formatting dashes in string interpolation

I have just been checking out the new string interpolation feature in C# 6.0 (refer to the Language Features page at …

c# string-formatting string-interpolation c#-6.0
PHP, strip_tags stripping \n in text area. How to stop it?

I would like to be able to accept \n or \r\n and convert them to <br /> for …

php string-formatting strip-tags
Str.format() for Python 2.6 gives error where 2.7 does not

I have some code which works well in Python 2.7. Python 2.7.3 (default, Jan 2 2013, 13:56:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "…

python python-2.7 string-formatting python-2.6 backwards-compatibility
What is the easiest way to pad a string with 0 to the left?

What is the easiest way to pad a string with 0 to the left so that "110" = "00000110" "11110000" = "11110000" I have tried to use …

rust formatting string-formatting number-formatting
How to show a comma separated number with StringFormat in XAML?

My code currently shows like this: 43521 reviews, I want it be like this: 43,521 reviews. How can I do that? and …

c# xaml windows-phone-8 windows-phone string-formatting