c# - Array.Clear(name, 0, len) not working -


i have string array declared this:

string[] stra9 = new string[64]; 

after using it, want reset elements null code

array.clear(stra9, 0, stra9.length); 

only clears first 3 elements used. can't access str9[5] without getting error saying element doesn't exist.

i thought .clear method reset array 64 null elements?

the way clearing array correct since same defined in documentation site, (maybe there behind code not posting in question).

string[] stra9 = { "a", "b","java" }; console.writeline(string.join(",", stra9)); console.writeline(stra9[1]); array.clear(stra9, 0, stra9.length); console.writeline(string.join(",", stra9)); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -