You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/tal-tech/go-zero/core/stringx"
|
|
)
|
|
|
|
func main() {
|
|
replacer := stringx.NewReplacer(map[string]string{
|
|
"日本": "法国",
|
|
"日本的首都": "东京",
|
|
"东京": "日本的首都",
|
|
})
|
|
fmt.Println(replacer.Replace("日本的首都是东京"))
|
|
}
|