First of all your code doesn't compile.
Second, your code doesn't do what you state - "Remove particular element from an array".
Third, what exactly do you mean by "Remove"? You want to set these elements to null or compact your array? In second case what do you need indexes of other elements for (their indexes will change when you compact your array)?
Ok, now lets start with a declaration of a contract:
You want to get a multivalue result: filtered array and indexes of remaining elements.
public struct Result
{
public readonly string[] FilteredArray;
public readonly List<int> IndexesOfRemainingElements;
public Result(string[] filteredArray, List<int> indexesOfRemainingElements)
{
FilteredArray = filteredArray;
IndexesOfRemainingElements = indexesOfRemainingElements;
}
}
Now, I'd rewrite your method in this way:
static Result FilterArray(string[] array, string[] input)
{
var remainingElements = array.Where(i => !input.Contains(i)).ToArray();
return new Result(remainingElements,
remainingElements.Select(i => Array.IndexOf(array, i)).ToList());
}
And finally you can call it:
string input = "Net Sales,COGS";
string[] values = { "Net Sales", "COGS", "COGS%", "Gross Profit", "GP%", "Quantity" };
// Split has an override that accepts params char[]
var result = FilterArray(values, input.Split(','));
Complete example here: https://dotnetfiddle.net/4wbfpC