mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
builtin: add string.split_by_whitespace()
This commit is contained in:
parent
b87283e970
commit
84fc9cec4b
2 changed files with 38 additions and 0 deletions
|
@ -902,3 +902,10 @@ fn test_sorter() {
|
|||
assert arr[2].s == 'ccc'
|
||||
assert arr[2].i == 102
|
||||
}
|
||||
|
||||
fn test_split_by_whitespace() {
|
||||
assert 'a bcde'.split_by_whitespace() == ['a', 'bcde']
|
||||
assert ' sss \t ssss '.split_by_whitespace() == ['sss', 'ssss']
|
||||
assert '\n xyz \t abc def'.split_by_whitespace() == ['xyz', 'abc', 'def']
|
||||
assert ''.split_by_whitespace() == []
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue