Hacker News new | ask | show | jobs
by martindevans 2685 days ago
String.Format("Is {0} to read {2} {1} of the {3} out of place", "harder", "half", "because", "string is").
1 comments

Ironically that’s actually also one of the key advantages of it. If you have a long string with many placeholders in it and need to add a new one in the middle... you just add it and don’t have to figure out where in the list of params to insert the new arg.
This is not much of an advantage with respect to string interpolation as you could just as easily put your new value in a (nicely named) variable and insert it wherever.
Not so nice for the next guy, though.
Yes, God forbid the variable appear more than once.