Saturday, March 5, 2011

Best way to use string in vb.net programming


Best way to use string in vb.net programming


This is the very useful object that you can manage your string, especially when you want to concatenate your string in the loop.


Old:

Dim I as integer

Dim s as string

For I = 1 to 10000

S = s & "concat string"

next


new:
dim I as integer

dim s as new system.text.stringbuilder.

for I = 1 to 10000

s.append("concat string")

next


You will see a lot different when you have very long loop.

See more information here.

No comments:

Post a Comment