开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜