AccessProviderSample.AccessDBProvider.RemoveDriveFromPath C# (CSharp) Метод

RemoveDriveFromPath() приватный Метод

Ensures that the drive is removed from the specified path
private RemoveDriveFromPath ( string path ) : string
path string Path from which drive needs to be removed
Результат string
        private string RemoveDriveFromPath(string path)
        {
            string result = path;
            string root;

            if (this.PSDriveInfo == null)
            {
                root = String.Empty;
            }
            else
            {
                root = this.PSDriveInfo.Root;
            }

            if (result == null)
            {
                result = String.Empty;
            }

            if (result.Contains(root))
            {
                result = result.Substring(result.IndexOf(root, StringComparison.OrdinalIgnoreCase) + root.Length);
            }

            return result;
        }