powered by
Extract a specific segment from a path
extract_path_segment(path, segment_index)
A character vector containing the specified segment from each path.
A character vector of paths.
The index of the segment to extract.
extract_path_segment(c("/path/to/resource", "/another/path/"), 2)
Run the code above in your browser using DataLab