I'm trying to separate the numbers (including Double) from a string such as "4+5*(4.5+6)". I thought about using a scanner to separate the numbers from my string. I would like to hear if there is a better way to do it, and to know how can i do it with a Scanner? This is my code, just wanted to check if it works and it threw an Exception...
package testzehavit;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner s= new Scanner("443+54+24");
s.useDelimiter("+");
System.out.println(s.next());
}
}
Thank you