Top "String-formatting" questions

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

How to format localised strings in Swift?

I am learning to localise my app to Simplified Chinese. I am following this tutorial on how to do this. …

ios swift internationalization string-formatting
Can Python's logging format be modified depending on the message log level?

I'm using Python's logging mechanism to print output to the screen. I could do this with print statements, but I …

python logging string-formatting
VLOOKUP is returning blank as 1/0/1990, rather than nothing visible

All cells are formatted for dates, when a cell is blank I would like it to return an apparently blank …

excel date formatting string-formatting vlookup
Python's many ways of string formatting — are the older ones (going to be) deprecated?

Python has at least six ways of formatting a string: In [1]: world = "Earth" # method 1a In [2]: "Hello, %s" % world Out[2]: …

python printf string-formatting deprecated backwards-compatibility
StringFormat on Binding

View: <TextBlock Text="{Binding Date}"/> I want to format the Date to "dd/MM/yyyy", in other words, …

c# xaml uwp string-formatting date-formatting
f-string syntax for unpacking a list with brace suppression

I have been examining some of my string format options using the new f-string format. I routinely need to unpack …

python python-3.x string-formatting python-3.6 f-string
How can I format a decimal bound to TextBox without angering my users?

I'm trying to display a formatted decimal in a TextBox using data binding in WPF. Goals Goal 1: When setting a …

wpf textbox decimal string-formatting
Format a float in Python with a maximum number of decimal places and without extra zero padding

I need to do some decimal place formatting in python. Preferably, the floating point value should always show at least …

python string-formatting padding
Clever way to append 's' for plural form in .Net (syntactic sugar)

I want to be able to type something like: Console.WriteLine("You have {0:life/lives} left.", player.Lives); instead of …

c# .net string-formatting
Printing boolean values True/False with the format() method in Python

I was trying to print a truth table for Boolean expressions. While doing this, I stumbled upon the following: >&…

python python-2.7 boolean string-formatting string.format