Hi all, just nit picking about Clojure's String API.
I've been comparing it with
Java's, and I noticed that (not surprisingly) they are very similar.
There are just 2-3 functions that exist in Java but don't have an equivalent in Clojure. I was wondering if they could be worth adding to clojure.string :
(.indexOf s "c") and (.lastIndexOf "c")
(.startsWith s "danc") and (.endsWith s "ing")
(.charAt s 5) same as (get s 5) but expresses a clearer intent. It's less general than (get) though as it only applies to Strings, so that might be unnecessary sugar.
.indexOf and .lastIndexOf are indicated in the
Clojure Cheatsheet, maybe .startsWith and .endsWith also deserve to be mentioned there?
I've been wondering why some functions have been ported, like (lower-case) for (.toLowerCase), but not the ones mentioned above.
I told you it was nit picking (^c^) Clojure's API is awesome as it is.