G
Guest
Hello,
I would like to be able to accept a format string in the form of say {0
2}
as an input from a dialog box, and then dynamically format the output string
based on this new format specifier.
So if I have something like this in my code:
String.Format("The number will look like this {0
2}",3);
It would give:
"The number will look like this: 03"
BUT I want the number of zeroes to be user defined at runtime, so
that the user can ask for a width of say four instead {0
4}
"The number will look like this: 0003"
I've tried various things but I end up getting the actual format as part of
the string:
"The number will look like this: 3{0
4}"
Many thanks,
Ronnie
I would like to be able to accept a format string in the form of say {0

as an input from a dialog box, and then dynamically format the output string
based on this new format specifier.
So if I have something like this in my code:
String.Format("The number will look like this {0

It would give:
"The number will look like this: 03"
BUT I want the number of zeroes to be user defined at runtime, so
that the user can ask for a width of say four instead {0

"The number will look like this: 0003"
I've tried various things but I end up getting the actual format as part of
the string:
"The number will look like this: 3{0

Many thanks,
Ronnie