Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

How to clear an array of string

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
0
cmdolcet
Asked:
cmdolcet
1 Solution
 
bhmahlerCommented:
You can use Array.Clear
Dim s As String() = {"A", "B", "C"}
Array.Clear(s, 0, s.Length)

Open in new window

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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:
http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now