stringBuilder怎么用?
stringBuilder怎么用?
紫衣仙女
2018-12-31 14:00:23
TA貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個(gè)贊
stringBuilder很不錯(cuò)的,完全可以替代string,最主要的是它的效率高
//必須先實(shí)例化一個(gè)
stringBuilder sBuilder = new stringBuilder();
//您可以拼接執(zhí)行SQL語(yǔ)句,易于閱讀
sBuilder.Append("select * from tb1");
sBuilder.Append("where id=1");
上面同等于
strng sBuilder = "select * from tb1 where id=1";
舉報(bào)