• (chomp s)
Removes all trailing newline \n or return \r characters from
string. Note: String.trim() is similar and faster.
Deprecated in 1.2. Use clojure.string/trim-newline

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/string.clj:245 top

(defn ^String chomp
  "Removes all trailing newline \\n or return \\r characters from
  string.  Note: String.trim() is similar and faster.
  Deprecated in 1.2. Use clojure.string/trim-newline"
  {:deprecated "1.2"}
  [^String s]
  (replace-re #"[\r\n]+$" "" s))
Vars in clojure.contrib.string/chomp: defn
Used in 0 other vars

Comments top

No comments for chomp. Log in to add a comment.