"Substring" a Numeric Value
<p>In C#, what is the best way to "substring" (for lack of a better word) a long value.</p>

<p>I need to calculate a sum of account numbers for a trailer record but only need the 16 least significant characters.</p>

<p>I am able to this by converting the value to string but wondered if there is a better way in which it can be done.</p>

<pre><code>long number = 1234567890123456789L;
const long _MAX_LENGTH = 9999999999999999L;

if (number &gt; _MAX_LENGTH)
{
  string strNumber = number.ToString();
  number = Convert.ToInt64(strNumber.Substring(strNumber.Length - 16));
}
</code></pre>

<p>This will return the value 4567890123456789.</p>
