Find common directory path: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
|||
Line 1,507: | Line 1,507: | ||
</lang> |
</lang> |
||
=={{header|Mathematica}}== |
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
||
<lang Mathematica>FindCommonDirectory[x_] := If[StringTake[#, -1] != "/", StringTake[#, Max[StringPosition[#, "/"]]], #] & |
<lang Mathematica>FindCommonDirectory[x_] := If[StringTake[#, -1] != "/", StringTake[#, Max[StringPosition[#, "/"]]], #] & |
||
[Fold[LongestCommonSubsequence, First[x] , Rest[x]]] |
[Fold[LongestCommonSubsequence, First[x] , Rest[x]]] |