Improve code on Getting last split secction
<p>maybe using the latest technologies, in 3.5 SP1, is there a way to short this?</p>

<pre><code>// Bruno: add the empty row with column names
// -- select [CRM5].[USERGROUP].[UserGroup_id], [CRM5].[USERGROUP].[name] AS [name]
if (col.ToLower().Contains("] as ["))
{
   // [CRM5].[USERGROUP].[name] AS [name]
   splitColumn.Clear();    // clear the list
   splitColumn.AddRange(col.Trim().Split(' '));
   emptyRow.Append(String.Format(" '' AS {0},", splitColumn[splitColumn.Count - 1]));
}
else
{
   // [CRM5].[USERGROUP].[UserGroup_id]
   splitColumn.Clear();    // clear the list
   splitColumn.AddRange(col.Trim().Split('.'));
   emptyRow.Append(String.Format(" '' AS {0},", splitColumn[splitColumn.Count - 1]));
</code></pre>

<p>}</p>

<p>In other words, is there a way to retrieve the last element of a String when split?</p>

<p>maybe</p>

<pre><code>col.Trim().Split('.').Find(x =&gt; x.LastItem);
</code></pre>

<blockquote>
  <p>col is a String</p>
  
  <p>splitColumn is a List &lt; String ></p>
</blockquote>
