Format Specifiers: Formatted Element Output
Explore how to use format specifiers in D to control formatted output of elements within arrays and associative arrays. Understand how to customize delimiters, quotes for strings and characters, and display key-value pairs effectively.
We'll cover the following...
We'll cover the following...
Formatted element output
Format specifiers between %( and %) are applied to every element of a container (e.g. an array or a range):
The format string above consists of three parts:
-
%(: start of element format -
%s: format for each element -
%): end of element format
Each element is printed ...