What is the best way to clear an array of strings?

后端 未结 7 1376
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 02:13

What is the best way to clear an array of strings?

7条回答
  •  深忆病人
    2021-02-19 03:06

    Here's a simple call that I use to clear the contents of a string array:

    Public Sub ClearArray(ByRef StrArray As String())
        For iK As Int16 = 0 To StrArray.Length - 1
            StrArray(iK) = ""
        Next
    End Sub
    

    Then just call it with:

    ClearArray(myLocalArray)
    

提交回复
热议问题