Im making game plugin in java and Ive got problem with split function.
index = 0;
int leng = a.length;
while(index != leng){
arr = a[index].split("|"); //this is line 158
if(arr[1] == "blue"){
blues[index]= arr[1];
}else{
reds[index] = arr[1];
}
index++;
}
Im getting NullPointerException on line 158.
variable arr is just empty array.
Im printing variable “a” to make sure its not null.
“a” looks like this: 100 58 -9|red.
Can you help me? Thank you
splitreceives a regular expression, so instead ofarr = a[index].split("|");, doarr = a[index].split("\\|");