String [] words = { "apple", "orange", };
String Word = words[wordGenerator]; //wordsGenerator is just a rand(); which return a integer.
String [] letters;
List<String> wordList;
letters = new String[12];
wordList = new ArrayList<String>(Arrays.asList(letters));
letters = Word.split("(?!^)");
By doing the above code I know that I'll get a Array called 'letters' with the first 5 memory as a, p, p, l, e if it generate apple am I right?
If so, how can I pass this 5 strings from the 'letters' array into the wordList? The solution seems somehow easy but I just couldn't come out with it. Any help would be greatly appreciated. Thank you.