splitWordsLines method

Iterable<Iterable<string>> splitWordsLines([
  1. WordSplitMode mode = WordSplitMode.wordsOnly
])

First Splits the String into a List of lines, and then split each line into a list of words and word splitters following the mode

mode can be WordSplitMode.wordsOnly, WordSplitMode.whitespace, WordSplitMode.keepSplitters

  • if mode is WordSplitMode.wordsOnly, the string is splitted by any char of Get.wordSplitters resulting in a list containing only words. this is the default mode
  • if mode is WordSplitMode.whitespace, the string is splitted by any char of Get.whiteSpaceOrBreakChars resulting in a list containing only words and word splitters, excluding white spaces or breaklines.
  • if mode is WordSplitMode.keepSplitters, the final list will contain all characters of original string. Each entry of the list will be a full word or a word splitter, in exactly the same order as the original string.

Implementation

Iterable<Iterable<string>> splitWordsLines([WordSplitMode mode = WordSplitMode.wordsOnly]) => splitLines.map((x) => x.splitWords(mode)).toList();