Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WordSearch {
- static String[] findWord(String x, String[] y) {
- ArrayList<String> returnedList = new ArrayList<String>();
- for (int i = 0; i < y.length; i++) {
- if (x.toLowerCase().contains(y[i].toLowerCase()))
- returnedList.add(y[i]);
- }
- if (returnedList == null)
- returnedList.add("Empty");
- String[] simpleArray = new String[returnedList.size()];
- returnedList.toArray(simpleArray);
- return simpleArray;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment