Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Clojure

Idiom #254 Replace value in list

Replace all exact occurrences of "foo" with "bar" in the string list x

(replace {"foo" "bar"} x)
std::replace(x.begin(), x.end(), "foo", "bar");

New implementation...