Why I’m getting:
Index and length must refer to a location within the string.
Parameter name: length
when I compile this code:
http://pastebin.com/CW4EcCM8
some part of it:
public string findFileEnding(string file)
{
int index1 = file.IndexOf('.');
file = file.Substring(index1, file.Length);
return file;
}
Thanks;)
I am thinking there is a chance
Path.GetExtensioncould be something OP might want instead.notice that it returns extension with
.like.exehttp://msdn.microsoft.com/en-us/library/system.io.path.getextension.aspx