C++ Builder 參考手冊 ? System::Sysutils ? ExtractFileExt
從路徑和文件名里面提取文件名后綴部分
頭文件:#include <System.SysUtils.hpp>
命名空間:System::Sysutils
函數原型:
System::UnicodeString __fastcall ExtractFileExt(const System::UnicodeString FileName);
參數:
- FileName 路徑和文件名浸颓,字符串匀借;
返回值:
- 從路徑和文件名里面提取文件名后綴部分咱枉,包括點和后綴贷笛,例如 ".exe"跳座。
例子:獲取應用程序文件名的后綴部分翅楼,得到的是 ".exe"
void __fastcall TForm1::Button1Click(TObject *Sender)
{
UnicodeString s = Application->ExeName;
Memo1->Lines->Add(s);
s = Sysutils::ExtractFileExt(s);
Memo1->Lines->Add(s);
}
運行結果:
運行結果
相關:
- System::Sysutils::ChangeFileExt
- System::Sysutils::ChangeFilePath
- System::Sysutils::ExtractFileDir
- System::Sysutils::ExtractFileDrive
- System::Sysutils::ExtractFileExt
- System::Sysutils::ExtractFileName
- System::Sysutils::ExtractFilePath
- System::Sysutils::ExtractRelativePath
- System::Sysutils::ExtractShortPathName
- System::Sysutils
- std::_fullpath, std::_tfullpath, std::_wfullpath
- std::_makepath, std::_tmakepath, std::_wmakepath
- std::_splitpath, std::_tsplitpath, std::_wsplitpath
- <cstdlib>
C++ Builder 參考手冊 ? System::Sysutils ? ExtractFileExt