VB.NET StringBuilder [.NET]

文字列の結合、追加などにはStringクラスではなく、StringBuilerクラスを使用すると処理が早くなるようです。ループ内での処理で繰り返し文字列の処理を行う場合、有効です。


Dim oSql As New System.Text.StringBuilder

oSql.Append(" select * ")
oSql.Append(" from table1 ")
oSql.Append(" where id > 500 ")
oSql.Append(" order by id ")

Console.WriteLine(oSql.ToString)

コメント

人気の投稿