How to read first word of last line from text file?
<p>My input file contains <code>id</code>, <code>description Of Item</code>, <code>Price</code> and <code>date</code>. </p>

<p>I want to get the <code>id</code> of the last line of the file "filename" and increment it.</p>

<p>Here is what I have done so far:</p>

<pre><code>var last = File.ReadLines("file name").Last();
id = last[0] + 1;
Console.WriteLine(last[0]);
</code></pre>

<p>It only returns the first word and not the element example <code>30</code>. It gives <code>3</code> and not the whole <code>30</code>. </p>

<p>Where am I wrong?</p>