C# string replacement , not working

后端 未结 6 1543
悲哀的现实
悲哀的现实 2020-12-07 03:47

I have a string which I read in from :

TextReader tr = new StreamReader(this.dataPath );
string contents = tr.ReadToEnd(); 

The value of co

6条回答
  •  有刺的猬
    2020-12-07 04:26

    Try

    contents = contents.Replace(xmlString,xmlString + styleSheet );
    

    This is because the String class is immutable.

提交回复
热议问题