Using this below code i get the name only first 4 character.But i need the name except the last 4 character.
string fileName = Textbox1.text;
string newName = fileName.Substring(0, 4);
//ex: input abcdef.txt
//output:abcd
But i need output: abcdef
pls help!
thanks
Riad
I suppose what you really need is a file name without extension. For that, there’s a separate method called, naturally,
GetFileNameWithoutExtension.