path.basename
path.basename
Function
Returns the file name in the path.
Syntax
path(text).basename()
Parameters
None.
Return value
| Type | Description |
|---|---|
| String | File name. |
Code Example
result = path('root/docs/index.md').basename() // Output: index.md print result
Notes
- Does not determine whether the target actually exists.