add keywords utility example

This commit is contained in:
kevin
2020-08-19 17:58:57 +08:00
parent 22e75cdf78
commit 418f8f6666
5 changed files with 99 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"github.com/tal-tech/go-zero/core/stringx"
)
func main() {
replacer := stringx.NewReplacer(map[string]string{
"PHP": "PPT",
"世界上": "吹牛",
})
fmt.Println(replacer.Replace("PHP是世界上最好的语言"))
}