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 cb987ca02..099f90e78 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 v1.2.3