In a simple case like yours, it really doesn't matter. But, as a rule, strings are immutable, which means that every change to a string variable will create a new buffer in memory, copy new data and leave the old buffer. In case you perform a lot of string manipulations, this slows down your program and leads to a lot of abandoned string buffers that need to be collected by the garbage collector.
source share