how to clear an array index list and the re create it

I have the following code:

 Public tempArray() As String
  tempArray = strDataCOM1.Split(New Char() {Chr(13)}, StringSplitOptions.RemoveEmptyEntries)

Open in new window


I notice that my array is getting cleared out however my index is not re-dimensioning. I would like to clear old data left in the temparry and also set the array index to 0 and let it re create.

Thanks in advance
cmdolcetAsked:
Who is Participating?
 
Pawan KumarDatabase ExpertCommented:
Not very sure why you are doing this but you may need this. Please try this -

Clear method...

Array.Clear(tempArray , 0, tempArray.Length);
0
 
cmdolcetAuthor Commented:
Thanks, and then to further I redim my array length
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.