Search:

Type: Posts; User: Norm

Search: Search took 0.20 seconds.

  1. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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)
  2. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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.
  3. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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...
  4. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    See the API doc for the splt() method:



    Post a small section of the output and the code that is generating it.
  5. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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...
  6. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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...
  7. Replies
    14
    Views
    1,326

    Re: Help with file I/O scanning etc

    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.
Results 1 to 7 of 7