Protected void ChkNumFromString()
{
Regex re = new Regex(@"\d+");
Match
m = re.Match(txtNumbers.Text);
if
(m.Success)
{
lblResults.Text = string.Format("RegEx
found " + m.Value + " at position
" + m.Index.ToString());
}
else
{
lblResults.Text = "You didn't enter a string containing a
number!";
}
}
No comments :
Post a Comment