public String getParent() {int length = path.length(), firstInPath = 0;if (separatorChar == '\\' && length > 2 && path.charAt(1) == ':') {firstInPath = 2;}int index = path.lastIndexOf(separatorChar);if (index == -1 && firstInPath > 0) {index = 2;}if (index == -1 || path.charAt(length - 1) == separatorChar) {return null;}if (path.indexOf(separatorChar) == index&& path.charAt(firstInPath) == separatorChar) {return path.substring(0, index + 1);}return path.substring(0, index);}
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);}