digitalmars.D - std.format.doFormat help
- Asaf Karagila (4/4) Oct 10 2004 the documentation of the module is ambiguous,
- Sean Kelly (6/8) Oct 10 2004 Basically, usage is liek a more flexible version of printf. You can
- Asaf Karagila (11/19) Oct 10 2004 well, Murphy's Law hit me again on this subject..
- Walter (12/18) Oct 11 2004 This is what std.md5.printDigest() looks like:
- Asaf Karagila (6/25) Oct 12 2004 yes, i know.. but i didn't know of that when i posted the original messa...
the documentation of the module is ambiguous, can anyone please explain a bit about the doFormat usage ? Cheer, Asaf
Oct 10 2004
Asaf Karagila wrote:the documentation of the module is ambiguous, can anyone please explain a bit about the doFormat usage ?Basically, usage is liek a more flexible version of printf. You can supply optional format strings plus the stuff you want to print. It's really meant to be used via writef of string.format though. Do you have any specific questions? Sean
Oct 10 2004
"Sean Kelly" <sean f4.ca> wrote in message news:ckc12p$2run$1 digitaldaemon.com...Asaf Karagila wrote:well, Murphy's Law hit me again on this subject.. i was looking for a way to convert my md5 digest into a hexdecimal string, and only after i posted the question i saw std.string.format.. but still, my main question is what exactly is the parameter list for doFormat ? how does it look like ? Cheers, Asafthe documentation of the module is ambiguous, can anyone please explain a bit about the doFormat usage ?Basically, usage is liek a more flexible version of printf. You can supply optional format strings plus the stuff you want to print. It's really meant to be used via writef of string.format though. Do you have any specific questions? Sean
Oct 10 2004
"Asaf Karagila" <kas1 netvision.net.il> wrote in message news:ckd568$kmo$1 digitaldaemon.com...i was looking for a way to convert my md5 digest into a hexdecimal string, and only after i posted the question i saw std.string.format.. but still, my main question is what exactly is the parameter list for doFormat ? how does it look like ?This is what std.md5.printDigest() looks like: /* Prints a message digest in hexadecimal. */ void printDigest(ubyte digest[16]) { foreach (ubyte u; digest) printf("%02x", u); } I think what you're looking for is std.string.format(), not std.format.doFormat().
Oct 11 2004
"Walter" <newshound digitalmars.com> wrote in message news:ckfmut$2qum$2 digitaldaemon.com..."Asaf Karagila" <kas1 netvision.net.il> wrote in message news:ckd568$kmo$1 digitaldaemon.com...yes, i know.. but i didn't know of that when i posted the original message.. anyway, i solved my problem so everything is ok now.. Cheers, Asafi was looking for a way to convert my md5 digest into a hexdecimal string, and only after i posted the question i saw std.string.format.. but still, my main question is what exactly is the parameter list for doFormat ? how does it look like ?This is what std.md5.printDigest() looks like: /* Prints a message digest in hexadecimal. */ void printDigest(ubyte digest[16]) { foreach (ubyte u; digest) printf("%02x", u); } I think what you're looking for is std.string.format(), not std.format.doFormat().
Oct 12 2004