Method GetDepth
GetDepth(string)
Calculates the depth of a directory path.
Declaration
public static int GetDepth(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path for which to calculate the depth. |
Returns
Type | Description |
---|---|
int | The depth of the path as an integer. Returns 0 if path is null or whitespace. |
Examples
GetDepth("C:\\temp\\file.txt"); // Returns 2