How can I remove an item in an array?
This is what I have, which is not OK.
// fr_watchdog.items = public array
string numToRemove = "test";
fr_watchdog.items = Array.FindAll(fr_watchdog.items,
val => val != numToRemove).ToArray();
All done. I have found a solution for this problem (listed below). Is it possible to delete the question?
ArrayList items = new ArrayList();
int index = Array.IndexOf(items, "Delete me");
if ( index != -1 )
{
string[] copyStrArr = new string[items.Length - 1];
for ( int i = 0; i < index; i++ )
{
copyStrArr[ i ] = items[ i ];
}
for ( int i = index ; i < copyStrArr.Length; i++ )
{
copyStrArr[ i ] = items[i + 1];
}
}