Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace FirstInstance
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] numbers = { 1, 3, 4, 9, 2, 4 };
- int numToRemove = 4;
- int numIndex = Array.IndexOf(numbers, numToRemove);
- numbers = numbers.Where((val, idx) => idx != numIndex).ToArray();
- }
- }
- }
Add Comment
Please, Sign In to add comment