Emphatic

Emphatic

  • NA
  • 4
  • 1.3k

Exclude Non-Numeric Problem

Nov 19 2015 11:26 AM
string s= oElement2.InnerText;
 
string nonNumericValue = string.Concat(s.Where(a => !Char.IsDigit(a)));
double dblPrice = Convert.ToDouble(s);

I am parsing a webpage and the result "1,500\r\nIn Stock" crashes my application. I am trying to exclude all the nonnumeric characters. Is this Lambda Expression incorrect ? thank you in Advance.


Answers (3)