[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

TrimAndExpandFilename

Cleans and resolves a file path to the specified base directory name.

Declaration

Source position: lazfileutils.pas line 64

function TrimAndExpandFilename(

  const Filename: string;

  const BaseDir: string = ''

):string;

Arguments

Filename

  

File name for the function.

BaseDir

  

Base directory name used for a relative file path.

Function result

Cleaned and resolved file path.

Description

TrimAndExpandFilename is a String function used to remove whitespace and special characters in Filename, and to resolve the relative file path to the directory in BaseDir. TrimAndExpandFilename removes a trailing path delimiter in Filename, and calls ExpandFileNameUTF8 and TrimFilename to get the return value for the function.

The return value is an empty string ('') if Filename contains an empty string ('').


Version 3.2 Generated 2024-02-25 Home