func ResetValue(s *string, newValue string) {
sByte := []byte(*s)
for i := 0; i < len(sByte); i++ {
sByte[i] = ' '
}
*s = newValue
}
func main() {
oldVal := "旧值"
ResetValue(&oldVal, "新值")
fmt.Println(oldVal)
}
golang 字符串赋值
最新推荐文章于 2025-11-05 12:49:49 发布
1872

被折叠的 条评论
为什么被折叠?



