mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +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.")
|
(doc words "splits a string into words.")
|
||||||
(defn words [s]
|
(defn words [s]
|
||||||
(split-by s &[\tab \space]))
|
(split-by s &[\tab \space \newline]))
|
||||||
|
|
||||||
(doc lines "splits a string into lines.")
|
(doc lines "splits a string into lines.")
|
||||||
(defn lines [s]
|
(defn lines [s]
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
"collapse-whitespace works as expected")
|
"collapse-whitespace works as expected")
|
||||||
(assert-equal test
|
(assert-equal test
|
||||||
&[@"erik" @"sved" @"hej" @"foo"]
|
&[@"erik" @"sved" @"hej" @"foo"]
|
||||||
&(words "erik sved hej\tfoo")
|
&(words "erik sved\nhej\tfoo")
|
||||||
"words works correctly")
|
"words works correctly")
|
||||||
(assert-equal test
|
(assert-equal test
|
||||||
&[@"erik" @"sved" @"hej" @"foo"]
|
&[@"erik" @"sved" @"hej" @"foo"]
|
||||||
|
Loading…
Reference in New Issue
Block a user