mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-06 21:52:28 +08:00
feat: add ReplaceWithMap
This commit is contained in:
@@ -526,14 +526,14 @@ func ExampleIndexOffset() {
|
||||
// -1
|
||||
}
|
||||
|
||||
func ExampleReplaceByMap() {
|
||||
func ExampleReplaceWithMap() {
|
||||
str := "ac ab ab ac"
|
||||
replaces := map[string]string{
|
||||
"a": "1",
|
||||
"b": "2",
|
||||
}
|
||||
|
||||
result := ReplaceByMap(str, replaces)
|
||||
result := ReplaceWithMap(str, replaces)
|
||||
|
||||
fmt.Println(result)
|
||||
// Output:
|
||||
|
||||
Reference in New Issue
Block a user