Don't set variable if string does not start with six integers in c# 2.0?
<p>I have</p>

<pre><code>string customer_id;
</code></pre>

<p>In a for loop I assign a value coming from a database request</p>

<pre><code>customer = (Customer)records[i];
</code></pre>

<p>I want to assign customer_id to customer.entityId only if entityId (a string) starts with six integers.</p>

<p>So:</p>

<pre><code>string internal_id = "";
string customer_id = "";
Customer customer;
for (int i = 0, j = (response.pageIndex - 1) * _pageSize; i &lt; records.Length; i++, j++)
{
customer = (Customer)records[i];

internal_id = customer.internalId;
customer_id = customer.entityId;
}
</code></pre>

<p>If entityId is something like xxyyzz then ignore it, if it is 123456 xxyyzz then assign the two variables. How do I best perform this check?</p>

<p>Thanks in advance</p>
