Suppose i have this string : "X1 + X2 = Y3 + Y4 * Y5"
, from this string i wanna get an array {X1,X2,Y3,Y4,Y5}
My problem is how manage the following case : "X11 + X2 = Y3 + Y4 * Y5"
, in this case i would get an array : {X1,X11,X2,Y3,Y4,Y5}
and this is wrong because "X1"
doesn't exist .
I didn't develop any algorithm yet , my idea was two declare two arrays with values from X1..XN
and Y1..YN
and for each value check if it is contained in my string , but in this way i will have a trouble explained above .
I would like to know how to do it , i would prefer not to use any external library to do this .