Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dda3b46

Browse files
author
Ryan Neufeld
committed
Change commas to newlines in 1.03. Fixes clojure-cookbook#396
1 parent bb43edc commit dda3b46

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

01_primitive-data/1-03_concatenating-strings.asciidoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ single string:
3737
;; -> "ROT13: Whyvhf Pnrfne"
3838
3939
;; Or, to reconstitute a file from lines (if they already have newlines...)
40-
(def lines ["#! /bin/bash\n", "du -a ./ | sort -n -r\n"])
40+
(def lines ["#! /bin/bash\n"
41+
"du -a ./ | sort -n -r\n"])
4142
(apply str lines)
4243
;; -> "#! /bin/bash\ndu -a ./ | sort -n -r\n"
4344
----
@@ -80,7 +81,8 @@ of your +rows+ collection:
8081
----
8182
;; Constructing a CSV from a header string and vector of rows
8283
(def header "first_name,last_name,employee_number\n")
83-
(def rows ["luke,vanderhart,1","ryan,neufeld,2"])
84+
(def rows ["luke,vanderhart,1"
85+
"ryan,neufeld,2"])
8486
8587
(apply str header (interpose "\n" rows))
8688
;; -> "first_name,last_name,employee_number\nluke,vanderhart,1\nryan,neufeld,2"

0 commit comments

Comments
 (0)