Hi all, just nit picking about Clojure's String API.

I've been comparing it with Java's 
<http://www.tutorialspoint.com/java/java_strings.htm>, 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 
<http://clojure.org/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.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to