• (chomp s)
Removes all trailing newline \n or return \r characters from
string. Note: String.trim() is similar and faster.

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/str_utils.clj:99 top

(defn chomp
  "Removes all trailing newline \\n or return \\r characters from
  string.  Note: String.trim() is similar and faster."
  [s]
  (re-sub #"[\r\n]+$" "" s))
Vars in clojure.contrib.str-utils/chomp: defn
Used in 0 other vars

Comments top

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