我可以看到许多原因:
可读性
string s = string.Format("Hey, {0} it is the {1}st day of {2}. I feel {3}!", _name, _day, _month, _feeling);vs:
string s = "Hey," + _name + " it is the " + _day + "st day of " + _month + ". I feel " + feeling + "!";
格式说明符 (这包括您可以编写自定义格式符的事实)
string s = string.Format("Invoice number: {0:0000}", _invoiceNum);vs:
string s = "Invoice Number = " + ("0000" + _invoiceNum).Substr(..... )字符串模板的持久性
如果我要将字符串模板存储在数据库中怎么办?使用字符串格式:
_id _translation 1 Welcome {0} to {1}. Today is {2}. 2 You have {0} products in your basket. 3 Thank-you for your order. Your {0} will arrive in {1} working days.vs:
_id _translation 1 Welcome 2 to 3 . Today is 4 . 5 You have 6 products in your basket. 7 Someone 8 just shoot 9 the developer.


![为什么要使用String.Format?[重复] 为什么要使用String.Format?[重复]](http://www.mshxw.com/aiimages/31/442693.png)
