Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

vb.net - stringbuilder

  • 10-07-2007 06:33PM
    #1
    Registered Users, Registered Users 2 Posts: 938 ✭✭✭


    Trying to learn some vb but having some trouble understanding the stringbuilder class. From what I can tell, its purpose is to set a size
    on a string and allow easier manipulation of a string. Now when I
    try to do this

    Dim strexample as system.text.stringbuilder = "Test"

    I get an error value of type string cannot be converted to system.text.stringbuilder

    If I do this
    Dim strexample as system.text.stringbuilder("test")

    then I get a dimensionzing an array error.

    have I got this all wrong?


Comments

  • Registered Users, Registered Users 2 Posts: 4,276 ✭✭✭damnyanks


    Dim strexample as system.text.stringbuilder = new stringbuilder("lewrklj")

    ???


  • Registered Users, Registered Users 2 Posts: 938 ✭✭✭logic


    Thanks.....i'd left out the "new".

    Dim strexample As New System.Text.StringBuilder("lewrklj")


  • Registered Users, Registered Users 2 Posts: 4,276 ✭✭✭damnyanks


    Check out google or irc.freenode.org when you hit little syntax errors :)


Advertisement