How to clear an array of string

Posted on 2009-02-10
Last Modified: 2013-11-26
I have create an array of string however I can;t seem to find a way to clear the array values? can anyone help?

 tempArray() As String
Question by:cmdolcet
    LVL 8

    Accepted Solution

    You can use Array.Clear
    Dim s As String() = {"A", "B", "C"}
    Array.Clear(s, 0, s.Length)

    Open in new window

    LVL 85

    Expert Comment

    by:Mike Tomlinson
    Do you need to clear (reset) the fields?...or actually make the array "empty" (have no elements in it at all).

    If the latter, then use List(Of String) instead:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now