Suppose I have a String which begins with a number. How can I get/extract all the first numbers and convert them to an Integer? Don't want all the numbers on the String, I want the numbers since the first one until the last one before any other letter or character.
For example:
String s= "5634-abofrda/+l8908"; // 5634
String str="78695t08675jgk"; // 78695
How do I get the number 5634? I'm looking for a general solution, not specific for the cases decribed.