I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this?
Here is my code sofar
String s;
char[] b = inputString.toCharArray();
b = new char[b.length];
do
{
if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!='.'))
{
s = Character.toString(b[i]);
if(s.equals("+"))
{
t = 1;
}
else if(s.equals("-"))
{
t = 2;
}
else if // and so on
}
else
{
t = 1029;
}
//want to delete element here if they fail if test
}
This should do what you want: