diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-24T13·32+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-24T13·32+0200 |
commit | d6d5885c1567454754a0d260521bafa0bd5e7fdb (patch) | |
tree | e97b212c7d752c4b37ff29536c3c3315c11d3088 /doc | |
parent | 2e8fd4c5cdeb59ae2bd403aa5069993303e8388e (diff) |
Add replaceStrings primop
This is a generalisation of replaceChars in Nixpkgs.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/expressions/builtins.xml | 17 |
1 files changed, 17 insertions, 0 deletions
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" ]</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> |