C# replace string in string

后端 未结 7 1212
情歌与酒
情歌与酒 2020-12-09 10:57

Is it possible to replace a substring in a string without assigning a return value?

I have a string:

string test = "Hello [REPLACE] world";
<         


        
7条回答
  •  感情败类
    2020-12-09 11:23

    You can't. You have to assign the value, as strings are immutable.

    Built-in reference types (C# reference)

提交回复
热议问题