1

I have various kinds of inputs like $1.30 , $0.30 , 1.3Rs., 13EUR

How can i get the only integer value like $1.30 = 1 , $0.30=0 , 100.3Rs. = 100, 13EUR = 13

Sujit
  • 790
  • 1
  • 13
  • 27
  • I used [This](http://stackoverflow.com/questions/20047566/extracting-price-from-string) and [That](http://stackoverflow.com/questions/2221629/how-to-get-number-from-a-string). But both are different than me. And I dont't even know if it is possible by REGEX – Sujit May 30 '14 at 10:46

1 Answers1

3

You can use a regex to extract the data as you dont seem to care about the decimals

Regex.Match(yourString, "\\d+")

And then you can cast the results you get from the match

David Pilkington
  • 13,528
  • 3
  • 41
  • 73