diff options
author | Matus Goljer <dota.keys@gmail.com> | 2014-07-11 19:55:40 +0200 |
---|---|---|
committer | Matus Goljer <dota.keys@gmail.com> | 2014-07-11 19:59:08 +0200 |
commit | dc8a787c8472b734547414014d687ba765876e53 (patch) | |
tree | 3946b20ffb3619681a5ce4b90f8b6dcfcdf55ff1 /dev | |
parent | e7bd10599ad5884a86fa777cc58ca646b94f05c9 (diff) |
Add s-split-up-to
Diffstat (limited to 'dev')
-rw-r--r-- | dev/examples.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dev/examples.el b/dev/examples.el index fc4af1e..2f13635 100644 --- a/dev/examples.el +++ b/dev/examples.el @@ -148,6 +148,18 @@ (s-split "ö" "xyöözeföklmö") => '("xy" "" "zef" "klm" "") (s-split "ö" "xyöözeföklmö" t) => '("xy" "zef" "klm")) + (defexamples s-split-up-to + (s-split-up-to "\\s-*-\\s-*" "Author - Track-number-one" 1) => '("Author" "Track-number-one") + (s-split-up-to "\\s-*-\\s-*" "Author - Track-number-one" 2) => '("Author" "Track" "number-one") + (s-split-up-to "|" "foo||bar|baz|qux" 3 t) => '("foo" "bar" "baz|qux") + (s-split-up-to "|" "foo||bar|baz|qux" 3) => '("foo" "" "bar" "baz|qux") + (s-split-up-to ":" "a,b,c" 1) => '("a,b,c") + (s-split-up-to ":" "a,b,c" 10) => '("a,b,c") + (s-split-up-to "\n" "z\nefg\n" 5) => '("z" "efg" "") + (s-split-up-to "\n" "z\nefg\n" 5 t) => '("z" "efg") + (s-split-up-to "|" "foo||bar|baz|qux" 10) => '("foo" "" "bar" "baz" "qux") + (s-split-up-to "|" "foo||bar|baz|qux" 10 t) => '("foo" "bar" "baz" "qux")) + (defexamples s-join (s-join "+" '("abc" "def" "ghi")) => "abc+def+ghi" (s-join "\n" '("abc" "def" "ghi")) => "abc\ndef\nghi")) @@ -395,4 +407,3 @@ (s-word-initials "under_scored_words") => "usw" (s-word-initials "camelCasedWords") => "cCW" (s-word-initials "dashed-words") => "dw")) - |