;; Create a string from the given items and store it in x.
user=> (def x (print-str 1 "foo" \b \a \r {:a 2}))
#'user/x
;; It's a string.
user=> (string? x)
true
;; Notice that each item is separated by a space.
user=> x
"1 foo b a r {:a 2}"
;; Create a string from the given items and store it in x.
user=> (def x (print-str 1 "foo" \b \a \r {:a 2}))
#'user/x
;; It's a string.
user=> (string? x)
true
;; Notice that each item is separated by a space.
user=> x
"1 foo b a r {:a 2}"
user=> (def x "Hello!\nMy name is George.\n") #'user/x user=> (print-str x) "Hello!\nMy name is George.\n"
user=> (def x "Hello!\nMy name is Simon.\n") #'user/x user=> (print-str x) "Hello!\nMy name is Simon.\n"
user=> (def x "Hello!\nMy name is Simon.\n") #'user/x user=> (print-str x) "Hello!\nMy name is Simon.\n"
user=> (def x [1 2 3 4]) #'user/x user=> x [1 2 3 4] user=> (print-str x) "[1 2 3 4]"
user=> (def x [1 2 3 4]) #'user/x user=> x [1 2 3 4] user==> (print-str x) "[1 2 3 4]"
user=> (def x [1 2 3 4]) #'user/x user> x [1 2 3 4] user=> (print-str x) "[1 2 3 4]"
user=> (def x [1 2 3 4]) #'user/x user> x [1 2 3 4] ;; turn the data into a string... user=> (print-str x) "[1 2 3 4]" ;; ...and turn that string back into data! user=> (eval (read-string (print-str x))) [1 2 3 4]