mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 09:40:24 +08:00
17 lines
299 B
Go
17 lines
299 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/tal-tech/go-zero/core/stringx"
|
|
)
|
|
|
|
func main() {
|
|
replacer := stringx.NewReplacer(map[string]string{
|
|
"日本": "法国",
|
|
"日本的首都": "东京",
|
|
"东京": "日本的首都",
|
|
})
|
|
fmt.Println(replacer.Replace("日本的首都是东京"))
|
|
}
|