text: public string getParent(){int length_1 = path.Length;int firstInPath = 0;if (separatorChar == '\\' && length_1 > 2 && path[1] == ':'){firstInPath = 2;}int index = path.LastIndexOf(separatorChar);if (index == -1 && firstInPath > 0){index = 2;}if (index == -1 || path[length_1 - 1] == separatorChar){return null;}if (path.IndexOf(separatorChar) == index && path[firstInPath] == separatorChar){return Sharpen.StringHelper.Substring(path, 0, index + 1);}return Sharpen.StringHelper.Substring(path, 0, index);}