query
On this page

replaceStrings

builtins.replaceStrings

Primop
Docs pulled from | This Revision | about 2 hours ago

Takes 3 arguments

from, to, s


Given string s, replace every occurrence of the strings in from with the corresponding string in to.

The argument to is lazy, that is, it is only evaluated when its corresponding pattern in from is matched in the string s

Example:

builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar"

evaluates to "fabir".

This function is not defined in a .nix file. It is likely a builtins function or an alias of a builtins function. builtins functions are predefined functions provided by Nix.

Noogle detected

Aliases

Detected Type
replaceStrings :: [String] -> [String] -> String -> String

Implementation

This function is implemented in c++ and is part of the native nix runtime.