Follow by Email

How to clear an array in c#?

Here i will show you that how can u clear the array in one step..
lets fill the array first ...

string[] arr = new string[4];
arr[0] = "000";
arr[1] = "111";
arr[2] = "222";
arr[3] = "333";
Now to clear aarray just write the following code....
Array.Clear(arr, 0, arr.Length);

0 comments:

Post a Comment