ClojureDocs

Nav

Namespaces

Clojure/Conj 2026 — Charlotte, NC — Sept 30 - Oct 2 Learn More & Get Tickets →

replace

clojure.string

Available since 1.2 (source) Clojure/JVMClojureScriptbabashka
  • (replace s match replacement)
Replaces all instance of match with replacement in s.
 match/replacement can be:
 string / string
 char / char
 pattern / (string or function of match).
 See also replace-first.
 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. If you wish your replacement
 string r to be used literally, use (re-quote-replacement r) as the
 replacement argument. See also documentation for
 java.util.regex.Matcher's appendReplacement method.
 Example:
 (clojure.string/replace "Almost Pig Latin" #"\b(\w)(\w+)\b" "2ドル1ドルay")
 -> "lmostAay igPay atinLay"
© Rich Hickey. All rights reserved. Eclipse Public License 1.0

AltStyle によって変換されたページ (->オリジナル) /