functionlast_separatorpure
pure integer function last_separator(path)
The position of the last separator in path, / or \, or 0.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| path | character(len=*) | in | the path |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| last_separator | integer |
Source
Show the code
pure integer function last_separator(path)
character(len=*), intent(in) :: path !! the path
last_separator = max(index(path, '/', back=.true.), index(path, '\', back=.true.))
end function last_separator