I added a variable of type int and I used it to call something like:
x.ToString("0000");
I changed x to type string and now the above is invalid. Is the only way to format x now:
string.Format("{0:0000}",x);
or is there a short-cut?
I am using StringBuilder to build the string, so does the same apply for AppendFormat?
string.Format("{0:0000}",x)is not the same for different kinds of x (namelyintandstring). So I guess you'll not get desired result by using the above expression.