1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00

Add replaceStrings primop

This is a generalisation of replaceChars in Nixpkgs.
This commit is contained in:
Eelco Dolstra 2015-07-24 15:32:24 +02:00
parent 2e8fd4c5cd
commit d6d5885c15
4 changed files with 63 additions and 1 deletions

View file

@ -0,0 +1 @@
[ "faabar" "fbar" "fubar" "faboor" "fubar" ]

View file

@ -0,0 +1,8 @@
with builtins;
[ (replaceStrings ["o"] ["a"] "foobar")
(replaceStrings ["o"] [""] "foobar")
(replaceStrings ["oo"] ["u"] "foobar")
(replaceStrings ["oo" "a"] ["a" "oo"] "foobar")
(replaceStrings ["oo" "oo"] ["u" "i"] "foobar")
]