Skip to the content.

string

local string = import "github.com/jsonnet-libs/xtd/string.libsonnet"

string implements helper functions for processing strings.

Index

Fields

fn splitEscape

splitEscape(str, c, escape='\\')

split works the same as std.split but with support for escaping the dividing string c.

fn strReplaceMulti

strReplaceMulti(str, replacements)

strReplaceMulti replaces multiple substrings in a string.

Example:

strReplaceMulti('hello world', [['hello', 'goodbye'], ['world', 'universe']])
// 'goodbye universe'