How to get filename from a file "template.docx.amp" in c#?
I have got a strange template whose extension is ".docx.amp" . Now i want to get fileName. i.e "开发者_如何学Ctemplate". Path.GetFileNameWithoutExtension() fails as it returns template.docx. Is there any other built in mechanism or i will have to go the ugle string comparison/split way. Please suggest and give some workaround
Nope, you will have to use some kind of string split, eg:
var nameWithoutExtension = filename.Split('.')[0];
精彩评论