To get an element in an array use an index with the array name:
theArray[theIndex]
gets the element at theIndex.
Your array has 3 elements, you want the third one (index=2)
Type: Posts; User: Norm
To get an element in an array use an index with the array name:
theArray[theIndex]
gets the element at theIndex.
Your array has 3 elements, you want the third one (index=2)
Are you talking about the output from the Arrays class's toString() method?
That print out is only for debugging.
The data you want is in the array.
Why are you using the contents of genname to splt() the String? Did you try writing a small test program with some sample Strings as I suggested to see how split() worked? See post#6
It looks...
See the API doc for the splt() method:
Post a small section of the output and the code that is generating it.
The regex can be VERY complicated. In this case "," will work as the regex to separate the Strings that will be written to the array that is returned. Write a small test program that experiments...
The first place to look for how a method works is the API doc.
Also a search on the forum will give you some code samples.
then you could use the length of the search String in the String...
If the lines in the file are like you posted, you could use the String class's split() method with a comma on a line to get an array with 3 Strings. read the line into a String and split() it.