Answers for "how to get first word of a sentence in flutter"

0

how to get first word of a sentence in flutter

static String getFirstWord(String inputString) {
    List<String> wordList = inputString.split(" ");
    if (wordList.isNotEmpty) {
      return wordList[0];
    } else {
      return ' ';
    }
  }
Posted by: Guest on March-31-2021

Code answers related to "how to get first word of a sentence in flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language