1.3.0 permalink Arrow_down_16x16
  • (blank? s)
True if s is nil, empty, or contains only whitespace.

1 Example top

  • user> (clojure.string/blank? nil)
    true
    
    user> (clojure.string/blank? false)
    true
    
    user> (clojure.string/blank? "   ")
    true
    
    user> (clojure.string/blank? " a ")
    false
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/string.clj:225 top

(defn blank?
  "True if s is nil, empty, or contains only whitespace."
  {:added "1.2"}
  [^CharSequence s]
  (if s
    (loop [index (int 0)]
      (if (= (.length s) index)
        true
        (if (Character/isWhitespace (.charAt s index))
          (recur (inc index))
          false)))
    true))
Vars in clojure.string/blank?:
Used in 0 other vars

Comments top

No comments for blank?. Log in to add a comment.