Is there any .NET string.format compatible function for Delphi Win32 ?
I want to use it's argument order syntax.
I found one at delphi3000.com, but it's pretty simple and without supporting number precition, etc.
Don't you know any better open-source implementation ?
Thanks.
Use SysUtils.Format.
It also supports argument order syntax as string.format in .Net does.
You can change argument order like following example.
Format('%1:s - %0:d', [7, 'Text'])
As I was a C programmer, I thought SysUtils.Format was just like printf in C.
But SysUtils.Format is not just like "printf" and it's more powerful as RRUZ & Cosmin Prund taught me in the comments above. (I should have checked help ;-)
I wanted .Net's string.format mainly because I wanted to use it's famous argument order syntax.
Argument order syntax is useful especially for translating message text into languages (like English to Japanese), but I don't need .Net compatibility.
If you had to port .Net's code to Delphi win32, or you are very familiar with .Net's format syntax, these library would be useful if exists, but it isn't in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With