I have a very simple question about JAVA string filter I to want input this command to console.
add 100@10
which means execute add method input arguments 100 and 10 respectively.
I used
String[] s = str.split("@");
String a = s[0];// here can get 100
String b=s1];// get can get 10
I have two questions
first is how to do delete the at (@) character before put it to string.split()
second can anyone can provide some better solution to handle this kind of input ?
such as
add 1000@10 //only add,1000,10 need to take
times 1000@10 //only add,1000,10 need to take