From d6d5885c1567454754a0d260521bafa0bd5e7fdb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 24 Jul 2015 15:32:24 +0200 Subject: Add replaceStrings primop This is a generalisation of replaceChars in Nixpkgs. --- doc/manual/expressions/builtins.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc') diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml index cb987ca02772..099f90e786e5 100644 --- a/doc/manual/expressions/builtins.xml +++ b/doc/manual/expressions/builtins.xml @@ -733,6 +733,23 @@ removeAttrs { x = 1; y = 2; z = 3; } [ "a" "x" "z" ] + builtins.replaceStrings + from to s + + Given string s, replace + every occurrence of the strings in from + with the corresponding string in + to. For example, + + +builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar" + + + evaluates to "fabir". + + + + builtins.seq e1 e2 -- cgit 1.4.1