I have the below String assignment statement
String items[] = line.split("\",\"",15);
String fileNamet = items[1].replaceAll("\"","").trim();
I need to introduce a new if statement
if (valid) {
String items[] = line.split("\",\"",15);
} else {
String items[] = line.split("\",\"",16);
}
String fileNamet = items[1].replaceAll("\"","").trim();
Now items becomes local to the if loop and is giving me compilation errors. How can I declare the items array outside the if loop?