mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 23:20:00 +08:00
16 lines
259 B
Go
16 lines
259 B
Go
|
|
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是世界上最好的语言!"))
|
|||
|
|
}
|