Duplicate: String output: format or concat in C #?
Especially in the C # world using String.Format for everything that is very common, usually as a VB.NET developer, unless I should * I'm not String.Format,
I prefer regular string concatenation, for example:
V1 = V2 & "test-x" & V3 & "-;"
I feel better than this:
V1 = String.Format("{0} test-x {1} -;", V2, V3)
Am I missing something? Or is this just a personal preference?
Reasons to use String.Format (from answers) (I will try to keep this up to date)
- Localization is much simpler if you use String Format
- Obviously, it's easier to change the input format.
- It is more readable (however it is personal)
- Best performance
** Sometimes I need to change the style or replace the material dynamically, then I use String.Format *
dr. evil Dec 08 '08 at 14:12 2008-12-08 14:12
source share