Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: Approved Backlog
-
Component/s: None
-
Labels:None
-
Patch:Code and Test
-
Approval:Vetted
Description
Originally reported by Takahiro Hozumi
With a function as the "replacement" argument, clojure.string/replace-first returns nil if there is no match, instead of returning the original string unchanged.
user=> (use 'clojure.string) nil user=> (replace-first "abcdef" "ghi" "jkl") "abcdef" user=> (replace-first "abcdef" #"ghi" "jkl") "abcdef" user=> (replace-first "abcdef" #"ghi" (fn [a] "jkl")) nil
CLJ-753patch applied forCLJ-870addresses this one, too, applied Aug 18, 2012CLJ-753patch applied forCLJ-870addresses this one, too, applied Aug 18, 2012