0

Lets say I have a really long string that I need to have across multiple lines in the text editor for readability. Should I use StringBuffer or does it not matter? In other words is this:

string my_string = "there are lots of " +
"words here";

The same as this as far as performance goes?

string my_string = "there are lots of words here";

In other words, will I be creating multiple string objects in the first example and only one in the second? I want to make sure performance doesn`t suffer for readability purposes.

TwinPrimesAreEz
  • 1,699
  • 1
  • 12
  • 16

0 Answers0