1

I'd like to extract real numbers from a string in java. The string is circle(5.5) and I'd like to extract the 5.5. I think there is a way to do this with regex? but I'm not sure. Is there another way?

Daniel
  • 25
  • 4

2 Answers2

0

check out the this thread and especially the last answer

Community
  • 1
  • 1
ayush
  • 14,350
  • 11
  • 53
  • 100
0

You need to make pattern for number then parse it in double or float gives what you want. see this link

Community
  • 1
  • 1
Ishu
  • 12,797
  • 5
  • 35
  • 51