문제

What is the code to reset an array to its default state so that all the elements are erased?

도움이 되었습니까?

해결책

you can try Array.Clear method :

Array.Clear(myArray, 0, myArray.Length)

that will revert value of each array element to default (0, false, or Nothing depending on the element type as described in the link above).

Another option is to use Erase

Erase myArray

that will turn myArray variable to Nothing.

다른 팁

You can use Erase.

Erase YourArray
System.Array.Clear(Array, 0, Array.length)

You can switch 0 to Nothing it depends on the variable in your array

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top