extract substring after the first underscore
c#, split, substring
Solution
string newfilename = file.Substring(file.IndexOf('_') + 1);
Problem
I need to remove the underscore and all characters before it in my filename. The syntax of the filename is as follows: ``` <username>_<NameofFile>_<InstructorName>_<ClassName>.xls ``` I want to keep everything BUT the `<username>_` part. I tried using `.Split` as follows: ``` string newfilename = file.Split('_')[1]; ``` but that dropped everything and only kept `<NameOfFile>`. How could this be achieved?