Antlr4.StringTemplate.Misc.Utility.GetParent C# (CSharp) Method

GetParent() public static method

public static GetParent ( string name ) : string
name string
return string
        public static string GetParent(string name)
        {
            if (name == null)
                return null;

            int lastSlash = name.LastIndexOf('/');
            if (lastSlash == 0)
                return "/";

            if (lastSlash > 0)
                return name.Substring(0, lastSlash);

            return string.Empty;
        }