M
Mani Ram
Hi Guys,
I am new to C#. I have a xml string and I want to read a value of a
particular element. I do not want to use dom for this purpose. I think
Regular expression will solve this.
the code snippet goes like this...
string strMsg ="<MyTestXml><First>One</First><Second>Two</Second><Third>Three</Third></MyTestXml>"
Regex re1=new Regex(@"<First>.*?</First>",RegexOptions.IgnoreCase);
string strVal=re1.Match(strMsg).Value;
strVal now contains "<First>One</First>"
How do I read just the value [ in this case, One ] from the
expression. Any help is greatly appreciated.
I am new to C#. I have a xml string and I want to read a value of a
particular element. I do not want to use dom for this purpose. I think
Regular expression will solve this.
the code snippet goes like this...
string strMsg ="<MyTestXml><First>One</First><Second>Two</Second><Third>Three</Third></MyTestXml>"
Regex re1=new Regex(@"<First>.*?</First>",RegexOptions.IgnoreCase);
string strVal=re1.Match(strMsg).Value;
strVal now contains "<First>One</First>"
How do I read just the value [ in this case, One ] from the
expression. Any help is greatly appreciated.