string is immutable and stringbuilder is mutable

前端 未结 8 1327
轻奢々
轻奢々 2020-12-06 08:38

can any one explain with examples


Related Discussion: Most efficient way to concatenate strings?

8条回答
  •  悲哀的现实
    2020-12-06 09:15

    In C++ you could do this:

    std::string hello = "Hello, world!\r\n";
    hello[7] = 'W';
    

    In C#, you can't do this. Strings can't be changed.

提交回复
热议问题