Demo entry 5863783

test space character

   

Submitted by anonymous on Aug 12, 2016 at 16:21
Language: Clojure. Code size: 219 Bytes.

(defn test-string-is-word
  "Allow a string that represents an word, defined by not containing spaces."
  [x]
  {:pre [(string? x)]
   :post [(boolean? %)]}
  (if (some #(= \space %) (seq x))
    false
    true))

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).