Lets say i have this expression I10I20I-3++
which should give me 27. I just can't seem to find a way of removing those I
's, or if it is any other letter from the string. In addition I have to figure out a way to then evaluate the expression. I tried using regex, but no luck:
public static String removeIs(String input)
{
//String check = input.replaceAll("[^/+/-/*//^0-9/-]+", " ");
String check = input.replaceAll("[^-+*/^0-9/-](?![^(]*\\))"," ");
return check;
}