C# string replacement , not working

后端 未结 6 1566
悲哀的现实
悲哀的现实 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:28

    The Replace() method returns a new string object, so you'll have to change your code to:

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

提交回复
热议问题