Spit Operation

Hi all

I split a string on the basis of newline initially and then on the basis of space but while using for each loop for the values after splitting on the basis of space and storing them in an array and then trying to extract value from that array there is error “index out of bound”. How to resolve this issue

@mhk15 You may be extracting element from array position which is not present in array, please check it once


Hi, Maybe you should start in index(0). :blush:

Use do while i=o to arr.length-1 and increment i in loop

1 Like