method str.splitWhitespace
The words of the text: pieces separated by runs of whitespace, without empty pieces.
Example:
fn main() io {
print("{" one two\tthree\n".splitWhitespace()}")
}Вывод
["one", "two", "three"]
Splits at runs of whitespace; no empty parts.
Example:
fn main() io {
print("{" a b\tc ".splitWhitespace()}")
}Вывод
["a", "b", "c"]
pub(api) fn splitWhitespace() -> List<str>Сложность. O(n).
С версии. 1.0.0-beta
Возвращает
List<str>
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/text.oxl:503