Change strings from one string to another in an array based on a condition
<p>I have an array of strings, most of which are string values "true" or "false", there are other strings there but i don't wish to alter them.</p>

<p>So i wish to loop through the strings and where i encounter the word "true" or "false" i want to change the string to "1" or "0"</p>

<p>These strings of 1, 0 and others will end up being used as parameters passed to a SQL stored procedure IE: seCmd.Parameters["@CheckListRef"].Value = data[0];</p>

<p>I am merely struggling with the syntax and therefore seeking guidence</p>

<pre><code>string[] data = args.Trim().Split(',');

// Loop over strings
foreach (string s in data)
{
    if(s == "true")
    {
        convert the string True to the string 1
    }
    else if(s == "false")
    {
      convert the string True to the string 0
    }
}
</code></pre>

<p>please can someone offer some guidance</p>
