Clojure

Add starts-with? ends-with? contains? to clojure.string

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.6
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Approval:
    Triaged

Description

Add clojure.string/starts-with? ends-with? and contains?, similar to java.lang.String's startsWith/endsWith/contains. In addition to making these easier to find and use, this provides a place to add a portable ClojureScript variant.

Activity

Alex Miller made changes -
Field Original Value New Value
Approval Triaged [ 10120 ]
Labels string
Alex Miller made changes -
Description While `clojure.string` wraps most of `java.lang.String`'s method, for some reason `startsWith` and `endsWith` were left out. Sure, in Java, one can use them fairly easy via the interop, but what if you're using ClojureScript (JavaScript's String class has not methods)? There's also the question of inconsistency, as the criteria by which String method were chosen for wrapping is unclear.

Should you approve this for inclusion I'd happily implement it.

P.S. The omission of `substring` is also a bit puzzling.
Add clojure.string/starts-with? and ends-with? similar to java.lang.String's startsWith/endsWith. In addition to making these easier to find and use, this provides a place to add a portable ClojureScript variant.
Andy Fingerhut made changes -
Description Add clojure.string/starts-with? and ends-with? similar to java.lang.String's startsWith/endsWith. In addition to making these easier to find and use, this provides a place to add a portable ClojureScript variant.
Add clojure.string/starts-with? ends-with? and contains?, similar to java.lang.String's startsWith/endsWith/contains. In addition to making these easier to find and use, this provides a place to add a portable ClojureScript variant.
Summary Add starts-with? and ends-with? to clojure.string Add starts-with? ends-with? contains? to clojure.string
Andy Fingerhut made changes -
Attachment clj-1149-basic-v1.patch [ 13294 ]
Andy Fingerhut made changes -
Attachment clj-1449-more-v1.patch [ 13295 ]

People

Vote (6)
Watch (1)

Dates

  • Created:
    Updated: