When I write out a string combined with several strings (i.e. use stringbuilder or concat), I need to insert a space between each string. I'm often doing that like this:
StringBuilder sb = new StringBuilder();
sb.Append("a" + " " + "b");
Is there a more concise way of doing the above?
Thanks
It's bizarre how many people just completely ignore the AppendFormat method on StringBuilder:
sb.AppendFormat("{0} {1}", str1, str2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With