1
1
mirror of https://github.com/tweag/nickel.git synced 2024-09-20 08:05:15 +03:00

Flip strings.replace

This commit is contained in:
silverraven691 2021-11-25 18:34:12 +01:00
parent 0103e0818b
commit a437990ce0

View File

@ -261,17 +261,17 @@
replace: Str -> Str -> Str -> Str
| doc m#"
`replace str sub repl` replaces every occurence of `sub` in `str` with `repl`.
`replace sub repl str` replaces every occurence of `sub` in `str` with `repl`.
For example:
```nickel
replace "abcdef" "cd" " " =>
replace "cd" " " "abcdef" =>
"ab ef"
replace "abcdef" "" "A" =>
replace "" "A" "abcdef" =>
"AaAbAcAdAeAfA"
```
"#m
= fun s pattern replace =>
= fun pattern replace s =>
%strReplace% s pattern replace,
replaceRegex: Str -> Str -> Str -> Str