public void check(String str){
for(int i =0; i<str.length(); i++){
//Print only the numbers
}
}
In that for loop I want to be able to look through the string and find just the first two numbers. How do I do that?
Example:
str= 1 b 3 s 4
Print: 1 3