Is it possible using fmt.Sprintf()
to replace all variables in the formatted string with the same value?
Something like:
val := "foo"
s := fmt.Sprintf("%v in %v is %v", val)
which would return
"foo in foo is foo"
Is it possible using fmt.Sprintf()
to replace all variables in the formatted string with the same value?
Something like:
val := "foo"
s := fmt.Sprintf("%v in %v is %v", val)
which would return
"foo in foo is foo"
是否可以使用 具有相同的值? p>
类似的东西: p>
将返回 p>
fmt.Sprintf() code>替换格式字符串中的所有变量 p>
val:=“ foo”
s:= fmt.Sprintf(“%v 在%v中是%v“,val)
code> pre>
” foo中的foo是foo “
code> pre>
div>