How To Get First Word Of A Sentence In Flutter

[Solved] How To Get First Word Of A Sentence In Flutter | Swift - Code Explorer | yomemimo.com
Question : how to get first word of a sentence in flutter

Answered by : raksha-deshmukh

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

Source : | Last Update : Wed, 07 Apr 21

Answers related to how to get first word of a sentence in flutter

Code Explorer Popular Question For Swift