Skip to content

Commit d733630

Browse files
make docs
1 parent a038946 commit d733630

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/string.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local string = import "github.com/jsonnet-libs/xtd/string.libsonnet"
1313
## Index
1414

1515
* [`fn splitEscape(str, c, escape='\\')`](#fn-splitescape)
16+
* [`fn strReplaceMulti(str, replacements)`](#fn-strreplacemulti)
1617

1718
## Fields
1819

@@ -24,3 +25,18 @@ splitEscape(str, c, escape='\\')
2425

2526
`split` works the same as `std.split` but with support for escaping the dividing
2627
string `c`.
28+
29+
30+
### fn strReplaceMulti
31+
32+
```ts
33+
strReplaceMulti(str, replacements)
34+
```
35+
36+
`strReplaceMulti` replaces multiple substrings in a string.
37+
38+
Example:
39+
```jsonnet
40+
strReplaceMulti('hello world', [['hello', 'goodbye'], ['world', 'universe']])
41+
// 'goodbye universe'
42+
```

0 commit comments

Comments
 (0)