Removes path from filename.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename |
File name |
Returned string with path removed
pure function stringtool_obj_RemovePath(filename) result(val) !> Removes path from filename. character(len=*), intent(in) :: filename !! File name character(len=:), allocatable :: val !! Returned string with path removed ! Work variables integer :: last_slash val=trim(adjustl(filename)) ! Find last path separator and last dot last_slash = index(val, '/', back=.true.) if (last_slash > 0) & val = val(last_slash+1:len_trim(val)) return end function stringtool_obj_RemovePath