From c03cad7a56237c01e4ff7e0fc0ccd100d52857c2 Mon Sep 17 00:00:00 2001 From: Steven Degutis Date: Tue, 9 Feb 2016 17:49:45 -0600 Subject: [PATCH] Update splitting-on-whitespace.md --- clojure/splitting-on-whitespace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clojure/splitting-on-whitespace.md b/clojure/splitting-on-whitespace.md index c83df77..09ce35d 100644 --- a/clojure/splitting-on-whitespace.md +++ b/clojure/splitting-on-whitespace.md @@ -20,7 +20,7 @@ what you want: A quick fix might look like this: ```clojure -(clojure.string/split "double spacing wtf?" #"[ ]+") +(clojure.string/split "double spacing wtf?" #" +") ; ["double" "spacing" "wtf?"] ``` @@ -29,6 +29,6 @@ tabs and new lines. Assuming we want to split on all whitespace, we should tell our regular expression to do just that: ```clojure -(clojure.string/split "we\thave new\nlines and tabs\n" #"[\s]+") +(clojure.string/split "we\thave new\nlines and tabs\n" #"\s+") ; ["we" "have" "new" "lines" "and" "tabs"] ```