string.replace() not working with xml string

Win Z

New Member
I have read all similar questions and acted accordingly. But still can't figure out what's wrong with my code.This is my code, super simple. (I know this isn't valid XML. It's just for the example).\[code\]string replacement = "TimeSheetsReplaced";string word = "TimeSheets";string result = "<?xml version=\"1.0\" encoding=\"utf-16\"?><DisplayName>Timesheets</DisplayName>"; result = result.Replace("<DisplayName>" + word + "</DisplayName>", "<DisplayName>" + replacement + "</DisplayName>");\[/code\]The result string remains unplaced. What am I doing wrong??
 
Back
Top