Delphi Drawers

パスからフォルダ名を取得

ファイルパスからフォルダ名を抽出します。

function fnGetFolderNameByFilePath(strPath:string):string;
begin
  strPath := StringReplace(strPath, '/', '\', [rfReplaceAll]);
  strPath := ExtractFilePath(strPath);
  strPath := ExcludeTrailingPathDelimiter(strPath);
  strPath := ExtractFileName(strPath);
  fnGetFolderNameByFilePath := strPath;
end;
Copyright © 2006 Hikijishi All Rights Reserved.
[] [delphi][0.00206398963928223]