static String getFirstWord(String inputString) { List<String> wordList = inputString.split(" "); if (wordList.isNotEmpty) { return wordList[0]; } else { return ' '; } }