| Magic File Renamer 6.1

Index > Reference > Formatting Parameters > General Group > Substring

Description:
Extracts part of any other format string at a specified location. Location is specified by a start position and end position.
Positions are 1-based (1 is the index of the first character in string).
Input a negative position to start counting from the right side instead of the left. (-1 is the last character index in string).
If you input an out of range position, it will be trimmed to the nearest limit.
Signature:
`<substr:start-position,end-position,source-format-string>`
Parameters:

Parameter | Description
`start-position` | Index of the first character in source format string, to include in the substring.
`end-position` | Index of the last character in source format string, to include in the substring.
`source-format-string` | String to extract substring from. Must be Any other legal format string or literal.

Example:
For the item `C:\Example\MyTestFileName.123`

`<substr:1,5,<file-name>>` | `MyTes`
`<substr:5,-6,<full-name>>` | `stFileNam`
`<substr:-1,2,<file-extension>45>` | `2345`