简体   繁体   English

从 Pascal 中的完整路径获取文件名

[英]Get filename from full path in Pascal

I'm wondering how to get a file name from full path in Pascal.我想知道如何从 Pascal 中的完整路径获取文件名。

In .NET, we have two functions - Path.GetFileName and String.IndexOf, both of them allow to accomplish the task.在 .NET 中,我们有两个函数 - Path.GetFileName 和 String.IndexOf,它们都允许完成任务。

For example, "C:\docs\file.txt" will return "file.txt".例如,“C:\docs\file.txt”将返回“file.txt”。

What would be the Pascal equivalent?帕斯卡等价物是多少?

It is the ExtractFileName function.它是ExtractFileName function。 Thanks to Ken's comment.感谢肯的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM