字符串拼接
package str import ( "strconv" ) func ToString(args ...interface{}) string { result := "" for _, arg := range args { switch val := arg.(type) { case int: result += strconv.Itoa(val) case string: result += val } } return result }
=> abcd1245
有疑问加站长微信联系(非本文作者)