J
jmanion
Hello,
I have a problem, I'm hoping someone can help.
I have a string, lets say: "111111"; // Not always numeric
I have a format mask, lets say: "(00) 0000"; // Again, not always
numeric.
The mask and the value are passed into a method.
private string GiveMeTheFormattedString(string i_Value, string i_Mask)
{
}
I want the output of this method to be: "(11) 1111"
Remember, I can't assume that my input string or my mask will be
numeric and the mask will be different.
Help.
I've tried this:
string retVal = String.Format("{0:" + iMask + "}", i_Value);
No luck, it always comes back as the original input.
I even tried the above hard coding the format mask in, i.e. ("{0
00)
0000}",i_Value);
still no luck.
Thanks for the help, in advance.
John
I have a problem, I'm hoping someone can help.
I have a string, lets say: "111111"; // Not always numeric
I have a format mask, lets say: "(00) 0000"; // Again, not always
numeric.
The mask and the value are passed into a method.
private string GiveMeTheFormattedString(string i_Value, string i_Mask)
{
}
I want the output of this method to be: "(11) 1111"
Remember, I can't assume that my input string or my mask will be
numeric and the mask will be different.
Help.

I've tried this:
string retVal = String.Format("{0:" + iMask + "}", i_Value);
No luck, it always comes back as the original input.
I even tried the above hard coding the format mask in, i.e. ("{0

0000}",i_Value);
still no luck.
Thanks for the help, in advance.
John