String vs. StringBuilder

后端 未结 24 1299
眼角桃花
眼角桃花 2020-11-22 06:22

I understand the difference between String and StringBuilder (StringBuilder being mutable) but is there a large performance difference

24条回答
  •  灰色年华
    2020-11-22 06:48

    My approach has always been to use StringBuilder when concatenating 4 or more strings OR When I don't know how may concatenations are to take place.

    Good performance related article on it here

提交回复
热议问题