函数原型

func replaceAll(s1 string, old string, new string) string

参数介绍

参数名称参数介绍
s1待替换的数据
old需要被替换掉的数据
new替换的新数据

举例

待转换数据转换语句输出结果
asdfgfhjkq asdef vjrtareplaceAll("asdfgfhjkq asdef vjrta", "asd", "AAA")AAAfgfhjkq AAAef vjrta
10.3.5-5.2replaceAll("10.3.5-5.2", ".", "-")10-3-5-5-2

Was this page helpful?