SelectableExtOnString extension
Methods
-
countOfWords({int? toIndex})
→ int
-
Returns the count of words in the string. If
toIndex
if provided,
returns the count of words up to, but not including, that index.
-
indexAtEndOfWord(int word)
→ int
-
Returns the index immediately after
word
. Note, the first word is
word 1, and so on.
-
indexAtWord(int? word, {bool start = true})
→ int
-
Returns the index where
word
starts (or ends, if start
is false
).
Note, the first word is word 1, and so on.
-
indexOfCharacterAfter(int index, {bool includeWhitespace = true})
→ int
-
Returns the index into this string of the next character boundary after
the provided
index
.
-
indexOfCharacterBefore(int index, {bool includeWhitespace = true})
→ int
-
Returns the index into this string of the previous character boundary
before the provided
index
.
-
isApostropheAtIndex(int index)
→ bool
-
Returns
true
if the character at index
is an apostrophe (i.e. it is
the single-quote character 0x0027, or the single-quote-right character
0x2019).
-
isNonWordCharacterAtIndex(int index)
→ bool
-
Returns
true
if the character at index
is a non-word character.
-
isWhitespaceAtIndex(int index)
→ bool
-
Returns
true
if the character at index
is a whitespace character.