c# comparing strings, one from an array other from an entered value
<p>Basically comparing a string that is entered, and trying to get that position from the array.</p>

<p>If I initialize position to 0 then it returns the position zero of the array, if I initialize to 1 then it gives me the item in slot 1, so it's skipping the compare statement.</p>

<p>I also tried using <code>(custStatus == cardStatus[i])</code></p>

<pre><code>public static int discount(string []cardStatus, int []pDiscount, string custStatus)
{
    int position= 0;
    int discount;
    for(int i = 0; i &lt; 2; i++)
    {
        if (string.Equals(custStatus, cardStatus[i]))
            position = i;
    }
    discount = pDiscount[position];
    return discount;
}
</code></pre>
