i have a string like strValue = ID=\"Literal1"\" Text=\"This is example"....
now from above string i want to take first occurence of number i.e my output shuold be 1...
can anyone help me?
thx in advance
Finding first occurence of number
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vijay YadavRank #1,637 · 943 reputationPosted Mar 2, 2011, 1:05 AM EST
Try this:-
using System.Text.RegularExpressions;
Regex re = new Regex(@"\d+");
Match m = re.Match(strValue);
if (m.Success)
string num= m.Value;
Amruta Kirdat72 reputationPosted Mar 2, 2011, 1:21 AM EST
this is working...thx for ur reply...
Vijay YadavRank #1,637 · 943 reputationPosted Mar 2, 2011, 1:27 AM EST
Welcome!
VulpesRank #55 · 29.2K reputationPosted Mar 2, 2011, 7:15 AM EST