If you have solved the problem, please mark the post to let others know.
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Star
8783 Points
2327 Posts
I have to convert xml node to lower case by regex in C# without replacing each node
Sep 25, 2017 05:42 AM|Das.Sandeep|LINK
Hello All,
I have to change below XML to its node only in lower case. How can I do by Regex in C#?
<MyXML><SomeNode>Hello World</SomeNode></MyXML>
to
<myxml><somenode>Hello World</somenode></myxml>
Please give us feedback no matter whether you get your answer.
Please "Mark as Answer" if it's useful for you.
Regards,
Sandeep
Star
8783 Points
2327 Posts
Re: I have to convert xml node to lower case by regex in C# without replacing each node
Sep 25, 2017 11:12 AM|Das.Sandeep|LINK
I am able to fix this issue in C#
string sampleXML = "<TestXML><ChildNode>Hello World</ChildNode></TestXML><TestXML><ChildNode>Hello World</ChildNode></TestXML><TestXML><ChildNode>Hello World</ChildNode></TestXML>";
sampleXML = Regex.Replace(sampleXML, @"<(.|\n)*?>", m => m.Value.ToLower());
Please give us feedback no matter whether you get your answer.
Please "Mark as Answer" if it's useful for you.
Regards,
Sandeep
Star
8670 Points
2882 Posts
Re: I have to convert xml node to lower case by regex in C# without replacing each node
Sep 26, 2017 03:30 AM|Cathy Zou|LINK
Hi Das.Sandeep,
If you have solved the problem, please mark the post to let others know.
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.