code_junkie

What's the best string concatenation method using C#?

Nov 10th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. StringBuilder sb = new StringBuilder();
  2. sb.Append(someString);
  3.  
  4. string key = String.Join("_", new String[]
  5. { "Customers_Contacts", customerID, database, SessionID });
  6.  
  7. StringBuilder sb = new StringBuilder();
  8. sb.Append("string1");
  9. sb.Append("string2");
  10. ...etc...
  11. String strResult = sb.ToString();
Add Comment
Please, Sign In to add comment