mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-04 01:25:04 +03:00
Merge pull request #457 from hellerve/fix-string-words
Also split by newline in String.words
This commit is contained in:
commit
a34752413e
@ -108,7 +108,7 @@ If you want to replace all occurrences of the pattern, use `-1`.")
|
||||
|
||||
(doc words "splits a string into words.")
|
||||
(defn words [s]
|
||||
(split-by s &[\tab \space]))
|
||||
(split-by s &[\tab \space \newline]))
|
||||
|
||||
(doc lines "splits a string into lines.")
|
||||
(defn lines [s]
|
||||
|
@ -179,7 +179,7 @@
|
||||
"collapse-whitespace works as expected")
|
||||
(assert-equal test
|
||||
&[@"erik" @"sved" @"hej" @"foo"]
|
||||
&(words "erik sved hej\tfoo")
|
||||
&(words "erik sved\nhej\tfoo")
|
||||
"words works correctly")
|
||||
(assert-equal test
|
||||
&[@"erik" @"sved" @"hej" @"foo"]
|
||||
|
Loading…
Reference in New Issue
Block a user