I have a file of strings similar to:
AC00.1
AC00.2
AC11.3
I am using the following code:
String[] MyPrg = new String[2];
while ((t = in.readline()) != null) {
MyPrg = t.split(".");
System.out.println(MyPrg[0].toString());
}
I get error on first entry:
AC00.1
EXCEPTION: java.lang.ArrayIndexOutOfBoundsException: 0
java.lang.ArrayIndexOutOfBoundsException: 0
at Role2Tkn.main(Role2Tkn.java:224)
I would expect :
MyPrg[0] to contain AC00
and
MyPrg[1] to contain 1
What am I overlooking here?
Thanks for any help!!!
AC00.1
AC00.2
AC11.3
I am using the following code:
String[] MyPrg = new String[2];
while ((t = in.readline()) != null) {
MyPrg = t.split(".");
System.out.println(MyPrg[0].toString());
}
I get error on first entry:
AC00.1
EXCEPTION: java.lang.ArrayIndexOutOfBoundsException: 0
java.lang.ArrayIndexOutOfBoundsException: 0
at Role2Tkn.main(Role2Tkn.java:224)
I would expect :
MyPrg[0] to contain AC00
and
MyPrg[1] to contain 1
What am I overlooking here?
Thanks for any help!!!