I am trying to copy certain elements of an array into another. For example, I want to copy index 0 of lines into index 0 of links, index 3 of lines into index 1 of links, and so on (every 3 element of lines basically basically).
What I have so far keeps getting me an ArrayIndexOutOfBound error. Thank you for your help!
String[] lines = inputString.split(System.getProperty("line.separator"));
String[] links = new String[lines.length];
int j = 0;
for (int i = 0; i < lines.length; i++) {
links[i] = lines[j+3];
j++;
System.out.println(links[i]);
}