|
Question : formatting a string in vb.net(urgent)
|
|
i was trying to format a string. lets say a="abc" i want to format it in according to the field mask provided (for example if the field mask is @@###@@ the result is @@abc@@). I dont want to do concatenation operation. is there any way to do this using string.format or any other format function. the format function i used wasn't working for strings. i wrote the following line to print the result dim a as string="abc" MsgBox(Format(a, "@@###@@") 'it showed me @@###@@ any ideas??? Thanks
|
|
Answer : formatting a string in vb.net(urgent)
|
|
I think iboutchkine was going for something along the lines of:
Dim s As String s = "abc" s = String.Format("@@@{0:###}@@@",s) MsgBox(s)
Notice the Second parameter to the String.Format
|
|
|