Freigeben über


VersionControlPath.GetRelativeStartIndex Method

Given a path and folder, returns the index of the substring in path relative to the folder. If the path is not under the folder then 0 is returned (meaning the entire path).

MakeRelative(@"$/src/project/abc.cpp", @"$/src") -> 6 MakeRelative(@"$/src/project/abc.cpp", @"$/specs") -> 0 MakeRelative(@"$/src/project/abc.cpp", @"$/src/proj") -> 0

Namespace:  Microsoft.TeamFoundation.VersionControl.Common
Assembly:  Microsoft.TeamFoundation.VersionControl.Common (in Microsoft.TeamFoundation.VersionControl.Common.dll)

Syntax

'Declaration
Public Shared Function GetRelativeStartIndex ( _
    item As String, _
    folder As String _
) As Integer
public static int GetRelativeStartIndex(
    string item,
    string folder
)
public:
static int GetRelativeStartIndex(
    String^ item, 
    String^ folder
)
static member GetRelativeStartIndex : 
        item:string * 
        folder:string -> int
public static function GetRelativeStartIndex(
    item : String, 
    folder : String
) : int

Parameters

Return Value

Type: System.Int32
Index of relative path part in path.

.NET Framework Security

See Also

Reference

VersionControlPath Class

Microsoft.TeamFoundation.VersionControl.Common Namespace