5

In http://clojure.github.com/clojure-contrib/str-utils-api.html it is written that

String utilities for Clojure
Deprecated since clojure-contrib version 1.2

but it is not written what should I use instead. There are convenient functions like "chomp" or "re-partition" there.

What should I do to port old clojure v1.1 code to the recent version? Should I just copy functions from clojure-contrib directly to the source code?

Vi.
  • 37,014
  • 18
  • 93
  • 148

3 Answers3

2

Some of the functionality is in the clojure.string namespace. E.g., chomp exists as trim-newline, str-join is join.

Alex Taggart
  • 7,805
  • 28
  • 31
1

You can use clojure.contrib.string instead of str-utils contrib

(use 'clojure.contrib.string)
Ankur
  • 33,367
  • 2
  • 46
  • 72
  • Note that this is a general split out of the contrib library - each of the namespaces pretty much got their own library so they could evolve independently. If there are other contrib items you need, check the individual libraries. – deterb Aug 09 '12 at 05:40
  • I see ["clojure.contrib.string migrated to clojure.string"](http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go) phrase, but clojure.string seems to have fewer functions than clojure.contrib.string, notably there are not regex-related functions like re-partition. – Vi. Aug 09 '12 at 09:47
-1

yes, I think clojure/core string and re library is better for you.

number23_cn
  • 4,611
  • 26
  • 31