for example: strEquation="36+5-8X2/2.5"
My code is :
String[] tmp = strEquation.split("[X\\+\\-\\/]+");
for(int i=0; i<tmp.length; i++)
Log.d("Split array",tmp[i]);
and my output as i thought it would be :
36
5
8
2
2.5
I want the tmp
string array will put also the char I'm splitting with, like this:
tmp[0] = 36
tmp[1] = +
tmp[2] = 5
tmp[3] = -
tmp[4] = 8
tmp[5] = X
tmp[6] = 2
tmp[7] = /
tmp[8] = 2.5
Any idea how to do that ?