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
Post a Comment