String manipulation - Any other efficient way?

后端 未结 5 639
孤街浪徒
孤街浪徒 2021-01-20 09:52

I had a requirement where i need to insert an escape sequence in a given string variable, at places wherever a single quotes (\') appears. I tried using

5条回答
  •  执笔经年
    2021-01-20 10:45

    I would use a StringBuilder object rather than manually concatinating the strings. At least you would get some performance improvement out of that if your strings are large.

提交回复
热议问题