How to parse a string and find a specific text?
<p>I tried to use Regex and its working but in this case only if i type "NVIDIA" in capital letters.
I dont mind it to show me in label4 in capital letters.
But the search it self if the variable toPring will have "nvidia" or "NvIdiA" it will not show it the regex know to get the specific text if its capital or not.</p>

<p>Is there any way to make it that it will know to find the text in any way i type it in the toPrint ?</p>

<pre><code>private void videoCardType()
        {
            string graphicsCard = string.Empty;
            foreach (ManagementObject mo in searcher.Get())
            {
                foreach (PropertyData property in mo.Properties)
                {
                    if (property.Name == "Description")
                    {
                        graphicsCard = property.Value.ToString();
                    }
                }
            }

            string toPring = "NVIDIa";
            foreach (Match m in Regex.Matches(graphicsCard, toPring, RegexOptions.IgnoreCase))
            label4.Text = toPring;
        }
</code></pre>

<p>The problem is that if i put in toPrint "NVIDIa" then the text in label4 will be "NVIDIa" with small "a" while in the loop above graphicsCard contain "NVIDIA....gtx...."</p>

<p>I want that whatever i type in the toPrint variable it will show me it in label4 as it was original in the graphicsCard variable.</p>

<p>If i typed in toPring "NVIDIA" or "nvidia" or "NVidiA" in label4 it will be like in the graphicsCard "NVIDIA" according to what in the graphicsCard.</p>
