C# substring throws an exception
<p>This is my code:</p>

<pre><code>private string title(string pth) //I'm passing a path
{
    pth = System.IO.Path.GetFileNameWithoutExtension(pth); // I need an exact filename with no extension
    return pth.Substring(pth.IndexOf('-')+1, pth.Length).Trim(); // trying to return everything after '-'
}
</code></pre>

<p>it throws an exception... I have no idea why.
it's an extremely easy way to get the title from filename, but it's not working.</p>

<p>I've tried pth.Length-1, but it's not working either.</p>
