[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

How to read text file contents to a string array?

Hi ,
How can I read contents of file to string array?
If my file text.txt contents following :
point1
point2
point3

How to put it  in string array?

0
inditrozen
Asked:
inditrozen
1 Solution
 
cmalakarCommented:
Reading a file..

http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html

Use ArrayList to add all the strings..

Then use toArray() api of ArrayList to convert to string array
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now