21 Oct
2004
21 Oct
'04
6:01 p.m.
In article <989aceac04102110261565afaf@mail.gmail.com>,
Caleb Epstein
On Thu, 21 Oct 2004 04:47:01 -0400, Miro Jurisic
wrote:
A typesafe solution is to use "format ("%1%") % string(buf, len)" if I understand the question correctly.
That would only work for string types. The * width specifier can be used with ANY type, e.g.:
printf ("|%*d|", 6, 42);
Yields "| 42|".
You know, I am sure I knew that in the back of my head, but I only ever used it for strings. Thanks. meeroh