什么是更快的性能明智:使用 + 运算符、& 运算符或通过 string.format 构建字符串?
varname、title、city、state、orgtype 是我声明的变量。
例如:
1.
varname = title + " in " + city + ", " + state + ". Contact " + title + ". " + orgtype + " " + city + "."
2.
varname = title & " in " & city & ", " & state & ". Contact " & title & ". " & orgtype & " " & city & "."
3.
varname = string.format("{0} in {1}, {2}. Contact {0}. {3} {1}.", title, city, state, orgtype)