I want to i to iterate over each character in the string but i value does not goes over 1 even if string is longer
while(((check.charAt(i)=='0'||check.charAt(i)=='1'||check.charAt(i)=='2'||check.charAt(i)=='3'||check.charAt(i)=='4'||check.charAt(i)=='5'||check.charAt(i)=='6'||check.charAt(i)=='7'||check.charAt(i)=='8'||check.charAt(i)=='9'))
{
{
if(i==0)
{
check=check.substring(1,len);
}
else{
check=check.substring(0,i)+check.substring(i+1,len);
}
i=i+1;
}
Aucun commentaire:
Enregistrer un commentaire