getFileName
Requires a Node.js runtime ('qsu/node')Returns the file name within the path.
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
filePath | stringStringstr | ● | – |
| File or directory path | |||
withExtension named keyword | booleanbool | – | falseFalse |
| Returns the name with extension. | |||
namedThese parameters are passed as named parameters.
keywordThese parameters are passed as keyword arguments, or as a single dict in their place.
Returns
string
String
str
Examples
javascript
getFileName('/home/user/test.txt'); // 'test'
getFileName('/home/user/test.txt', true); // 'test.txt'dart
getFileName('/home/user/test.txt'); // 'test'
getFileName('/home/user/test.txt', withExtension: true); // 'test.txt'python
getFileName('/home/user/test.txt') # 'test'
getFileName('/home/user/test.txt', True) # 'test.txt'