aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-24 15:32:24 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-24 15:32:24 +0200
commitd6d5885c1567454754a0d260521bafa0bd5e7fdb (patch)
treee97b212c7d752c4b37ff29536c3c3315c11d3088 /doc
parent2e8fd4c5cdeb59ae2bd403aa5069993303e8388e (diff)
Add replaceStrings primop
This is a generalisation of replaceChars in Nixpkgs.
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/expressions/builtins.xml17
1 files changed, 17 insertions, 0 deletions
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" ]</programlisting>
</varlistentry>
+ <varlistentry><term><function>builtins.replaceStrings</function>
+ <replaceable>from</replaceable> <replaceable>to</replaceable> <replaceable>s</replaceable></term>
+
+ <listitem><para>Given string <replaceable>s</replaceable>, replace
+ every occurrence of the strings in <replaceable>from</replaceable>
+ with the corresponding string in
+ <replaceable>to</replaceable>. For example,
+
+<programlisting>
+builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar"
+</programlisting>
+
+ evaluates to <literal>"fabir"</literal>.</para></listitem>
+
+ </varlistentry>
+
+
<varlistentry><term><function>builtins.seq</function>
<replaceable>e1</replaceable> <replaceable>e2</replaceable></term>