PathUtil.GetCommonPathPrefix(String, String) Method

Definition

Returns the longest leading string that is common to path1 and path2. Case is not considered in the comparison.

public:
 static System::String ^ GetCommonPathPrefix(System::String ^ path1, System::String ^ path2);
public:
 static Platform::String ^ GetCommonPathPrefix(Platform::String ^ path1, Platform::String ^ path2);
 static std::wstring GetCommonPathPrefix(std::wstring const & path1, std::wstring const & path2);
public static string GetCommonPathPrefix (string path1, string path2);
static member GetCommonPathPrefix : string * string -> string
Public Function GetCommonPathPrefix (path1 As String, path2 As String) As String

Parameters

path1
String

The first path to compare

path2
String

The second path to compare

Returns

The longest common prefix, or String.Empty if there is no common prefix

Applies to