clojure.string/replace-first

functionsince v0.0-927 clojure.string/replace-firstEdit
(replace-first s match replacement)

Details:

Replaces the first instance of match with replacement in s.

The options for match / replacement are:

match replacement
string string
regex string
regex function

Source docstring:
Replaces the first instance of match with replacement in s.

match/replacement can be:

string / string
pattern / (string or function of match).

See also replace.

The replacement is literal (i.e. none of its characters are treated
specially) for all cases above except pattern / string.

For pattern / string, $1, $2, etc. in the replacement string are
substituted with the string that matched the corresponding
parenthesized group in the pattern.

Example:
(clojure.string/replace-first "swap first two words"
                              #"(\w+)(\s+)(\w+)" "$3$2$1")
-> "first swap two words"
Source code @ clojurescript:src/main/cljs/clojure/string.cljs
(defn ^string replace-first
  [s match replacement]
  (.replace s match replacement))