var pattern = @"\'(.*?)\'";
var query = "<ID Name='abc' EID='1' Age = '40l' Deptid = '9'/>";
var matches = Regex.Matches(query, pattern);
int indexes = matches.Count;
string[] myResult = new string[indexes];
int i = 0;
foreach (Match m in matches)
{
myResult[i] = m.Groups[1].Value;
i++;
}
Please Mark as Answer if find helpful -- Nasser -- Skype: maleknasser1
Marked as answer by prince2485 on May 08, 2012 01:58 PM
Nasser Malik
Star
10980 Points
1691 Posts
Re: how to split a string,c#/asp.net?
May 08, 2012 09:44 AM|LINK
var pattern = @"\'(.*?)\'"; var query = "<ID Name='abc' EID='1' Age = '40l' Deptid = '9'/>"; var matches = Regex.Matches(query, pattern); int indexes = matches.Count; string[] myResult = new string[indexes]; int i = 0; foreach (Match m in matches) { myResult[i] = m.Groups[1].Value; i++; }Skype: maleknasser1