C#.NET Fetch Tab Character from XML Attribute
<p>All,<br>
<strong>Process:</strong>  map Flat File to Application Object.<br>
<strong>Meta Data:</strong>  stored in Xml file.  Contains field name, delimter, and order number each stored in an attribute.<br>
<strong>Issue:</strong> When fetching the delimiter attribute in Application code, the Tab Character (\t) comes through like this:  <code>\\t</code> (double backslash t).</p>

<p><strong>Xml Sample:</strong></p>

<pre><code>&lt;field name= "Field1" delimiter='\t' orderNum="1"/&gt;
</code></pre>

<p><strong>Code Sample:</strong></p>

<pre><code>attrVal = node.Attributes["delimiter"].Value;
</code></pre>

<p><strong>Issue:</strong> I'm trying to split each line in the file on the delimiter.  Something like:</p>

<pre><code>string [] delim = new string[] { attrVal };
string line = streamReader.ReadLine();  
string[] record = line.Split(delim, StringSplitOptions.None);
</code></pre>

<p>However, because the delimiter is <code>\\t</code>(double backslash t), the Split function doesn't recognize it.  </p>

<p><strong>Questions:</strong> Should I strip off that first backslash using substring (is that even possible since it's an escape)?  Is there a different way I should be accessing the attribute in the Xml file so it won't escape the first backslash?  Any info would be appreciated.  Thanks in advance.</p>

<p>Joe</p>
