On Thursday, 3 August 2017 at 08:47:12 UTC, Martin Tschierschke wrote:
Can you point me to the explanation of this: %(%02X %)%*s  %s  ?

https://dlang.org/phobos/std_format.html

Under "Example using array and nested array formatting:"

writefln("My items are %(%s %).", [1,2,3]);

So "%( %)" is an array format specifier, with the stuff between the two as the element format. In the case of "%(%02X %)%*s %s", that reads:

"%("    // Start array format specifier for arg 1.
"%02X " // Format each element as a 2 digit hex number followed by a space.
"%)"    // End array format specifier.
"%*s" // Right justify arg 3 (""), using width specified by arg 2.
"  %s"  // And print arg 4 using no special format.

--
  Biotronic

Reply via email to