How to get file name without file extension : <p>Im trying to get file name without its extension, i have the following code that let me take the file name with extension which is </p>

<pre><code>var docName = new DirectoryInfo("C:\\files\\").GetFiles("*.docx");
</code></pre>

<p>with that code im taking all of the file names then use them on </p>

<pre><code> for(int a = 0; a &lt; docLength; a++)
        {
           Consol.WriteLine("Your File Name : {0}", docName[a] ) // this part is just ex.
        }
</code></pre>

<p>when i execute the program it will list the file names like</p>

<pre><code>Test.txt
test.docx
</code></pre>

<p>and etc.</p>

<p>how can i get the document names without their extensions like</p>

<pre><code>test
</code></pre>
