UDF > WinAPIEx > ShellPath >


_WinAPI_PathCommonPrefix

Compare deux chemins pour déterminer si ils partagent un préfixe commun

#include <WinAPIShPath.au3>
_WinAPI_PathCommonPrefix ( $sPath1, $sPath2 )

Paramètres

$sPath1 Le premier nom de chemin.
$sPath2 Le deuxième nom de chemin.

Valeur de retour

Retourne le préfixe commun, @extended contiendra le nombre de caractères communs du préfixe dans le chemin.

Voir aussi

Consultez PathCommonPrefix dans la librairie MSDN.

Exemple

#include <WinAPIShPath.au3>

Local $sPath1 = 'C:\Documents\Test.txt'
Local $sPath2 = 'C:\Documents\Archive\Sample.txt'

ConsoleWrite('Path1 : ' & $sPath1 & @CRLF)
ConsoleWrite('Path2 : ' & $sPath2 & @CRLF)
ConsoleWrite('Prefix: ' & _WinAPI_PathCommonPrefix($sPath1, $sPath2) & @CRLF)