How to split string in C#I am displaying all the project name in dropdownlist as follows
string sourceDirectory = Server.MapPath("~/");
DirectoryInfo directoryInfo = new DirectoryInfo(sourceDirectory);
var aspxFiles = new List(Directory.GetFiles(sourceDirectory, "*.aspx", SearchOption.AllDirectories));
foreach (string currentFile in aspxFiles)
When i run in dropdownlist output as follows
But i want in dropdownlist as follows Default.aspx
i want to split after \.
for that how can i do in asp.net using c#.
In dropdownlist i want output as follows