---
url: >-
  /statelake/scripting-reference/functions-and-procedures/file-functions/includetrailingpathdelimiter.md
---

# IncludeTrailingPathDelimiter

The **IncludeTrailingPathDelimiter** function returns the file path with a path delimiter on the end.

If the file path already has a delimiter on the end it will not add another, but if there is no delimiter at the end of the parameter **S**, then one will be added.

**Declaration**: Function IncludeTrailingPathDelimiter(const S : string) : string

Example

```pascal
procedure ScriptEvent (var Value : variant);
var
  f: string;
begin
 //Returns 'C:\test\'
  f := IncludeTrailingPathDelimiter('c:\test');
  LogInfo(f);

 //Returns 'C:\MyFiles\test\'
  f := IncludeTrailingPathDelimiter('C:\MyFiles\test');
  LogInfo(f);

 //Returns 'C:\MyFiles\test\\'
  f := IncludeTrailingPathDelimiter('C:\MyFiles\test\\');
  LogInfo(f);

 //Returns 'C:\MyData\MyFiles\test\'
  LogInfo(IncludeTrailingPathDelimiter('c:\MyData\MyFiles\test\'));
  LogInfo('');
end;
```
