For some reason that I don't understand, I'm getting a array out of bounds at
String ans1 = inputs[1]; The purpose of this code is to add questions and answers to 2 different array by splitting a single input string into multiple parts and add them to the input and output array respectively. I know what a array out of bounds is, I just dont understand why split is not working properly.
sl=tf.getText();
boolean tempsave = false;
if (sl.equalsIgnoreCase("!tempadmin"))
{
int ends = sIndata.length;
int endss = resdata.length;
int endends =0;
int endendss =0;
ta.append("adding options\n");
do{
String sp = tf.getText();
if (sl.equalsIgnoreCase("kill"))
{
tempsave = true;
};
String [] inputs = sp.split(";");
String qs1 = inputs[0];
String ans1 = inputs[1];
String[] qs2= qs1.split(":");
String[] ans2= ans1.split(":");
for (int qusilada = 0; qusilada != qs2.length; qusilada++){
sIndata[ends + 1][endends + qusilada] = qs2[qusilada];
resdata[endss + 1][endendss + qusilada] = ans2[qusilada];
ends++;
endss++;
}
sp = "";
}while (tempsave == false);
ta.append("tempadmin closed");
};