How to edit an specific subString in XML using C# -
i have xml file example looks this.
<file> <add key="1" val="great.me"/> <add key="2" val="notsogreat"/> <add key="3" val="lessgreat.me/yey" /> <add key="4" val="sogreat/yey" /> </file>
i replace value of .me .awesome.
ex: <add key="1" val="great.me"/>
to <add key="1" val="great.awesome"/>
and
ex: <add key="3" val="lessgreat.me/yey"
to <add key="3" val="lessgreat.awesome/yey"
can me guys? tia
try this,
string oldtext = file.readalltext(filepath); string newtext = oldtext.replace("me", "awesome"); file.writealltext(filepath, newtext, encoding.utf8); xmldoc = new xmldocument(); xmldoc.load(filepath);
Comments
Post a Comment