I want to show my string in a special format.
For example I have a string like this s = "00012345";
and want to show it in this format 000(123-45)
I use this code for it:
label1.text = string.format("{0,###(###-##)}",s);
But just see this for result: 00012345.
What string formatting should I be using?
As mentioned you can't format an already existing string. First you need to convert the string to an int:
Then you can do the formatting whilst converting it back into a string: