Answer the question
In order to leave comments, you need to log in
How to decrease the length of an array element by 1?
directoryFile[i][directoryFile[i].Length - 1] = directoryFile[i][directoryFile[i].Length - 1];
it will be a decrease in the length of the array?
Answer the question
In order to leave comments, you need to log in
Do you need to reduce the length of the ELEMENT of the array or the length of the array?
Either way, the code above will do neither.
An array cannot be reduced in length in c# - its length is set when memory is allocated. The length can be changed for other data structures, such as List. And there is a Remove method for that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question