0
Why i can't convert string to int in this code !! Some help please
2 ответов
+ 2
Line 9:
String[] arr = str.split("");
Line 17:
list.add(i);
I think you may also need to check whether each String array <arr> element was a digit, otherwise you'd end up with conversion error(s) trying to convert non numeric String into an integer.
+ 1
I added the trim() function in the input and it works fine
Thanks a lot