Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.17 seconds.

  1. Re: reading content of the text file, splitting it into strings

    No problem. If you use a List instead of an array, you might be able to "get around" that problem by only adding valid numbers. But I'm not sure of your actual requirements, so it's up to you.
  2. Re: reading content of the text file, splitting it into strings

    Please understand what you're doing at each step.

    Try playing with what is returned by row.split(" "). What type is it? What does it look like? Can you iterate over it? What is in each index?
    ...
  3. Re: reading content of the text file, splitting it into strings

    You already have the needed code. You already split the rows (which returns an array), and you already convert that array into a List.

    The only thing you have to do is, instead of simply printing...
  4. Re: reading content of the text file, splitting it into strings

    You already have the code that stores your data into a data structure.

    Instead of printing out the List returned from Arrays.asList(), store it to a variable. Try printing out its size, iterating...
Results 1 to 4 of 4