this is my code :
String addchar = "";
String tempchar;
int len = strline.length();
char[] chars = strline.toCharArray();
int amount = 0;
for (int i = 0; i < len; i++) {
tempchar = String.valueOf(chars[i]);
if (tempchar == "0" || tempchar == "1" || tempchar == "2" || tempchar == "3" || tempchar == "4" || tempchar == "5" || tempchar == "6" || tempchar == "7" || tempchar == "8" || tempchar == "9") {
addchar=tempchar+addchar;
}
}
amount=Integer.parseInt(addchar);
but when run this code , I see that amount
is empty!
I want to extract , the number that there is in strline