I have some strings like " 8 2 / 5", "5 5/ 7" and so on, containg math fractions. I need to convert them into doubles. So, how can I get these parts " 8 " "2 / 5", into variables?
var src = " 8 2 / 5";
string base = getBase(src);
string frac = getFrac(src);
// Now base must contain "8" and frac "2/5";
I don't know if some stuff could do this "fraction-to-double" task is already exist (if so, give a link or something), but if I could get these parts into variables I would be able to perform a division and an addition at least.