c# clear an array
using System;
Array.Clear(arrayToClear, 0, arrayToClear.Length);
c# clear an array
using System;
Array.Clear(arrayToClear, 0, arrayToClear.Length);
how to remove an element from an array c#
static void Main(string[] args)
{
int[] arr = { 1, 3, 4, 9, 2 };
int numToRemove = 3;
var numIndex = arr.Where(x=>x ==numToRemove);
if(numIndex.Any()){
var idx = Array.IndexOf(arr,numToRemove);
var remove = arr.Remove(idx);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us