how to read a file using libgdx

https://w‮ww‬.lautturi.com
how to read a file using libgdx

libgdx is a Java game development library.libGDX is a free and open-source game-development application framework written in the Java programming language with some C and C++ components for performance dependent code. It allows for the development of desktop and mobile games by using the same code base.

FileHandle handle = Gdx.files.local("words.txt");
String text = handle.readString();
String wordsArray[] = text.split("\\r?\\n");
for(String word : wordsArray) {
  words.add(word);
}
Created Time:2017-10-03 16:11:18  Author:lautturi