How do you find the relative path?

Alvin Le

Member
How do you find the relative path?
Answer
5 Answers
  1. start by finding the longest common prefix which ends with a path-separator.
  2. if there is no common prefix, you are done.
  3. strip the common prefix from (a copy of…) the current and target strings.
  4. replace each directory-name in the current string with “..”
 

Tìm kiếm

Back
Top