Files
go-zero/example/stringx/replace/replace.go

16 lines
259 B
Go
Raw Normal View History

2020-08-19 17:58:57 +08:00
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是世界上最好的语言"))
}