Pchp.Library.PhpPath.GetScheme C# (CSharp) Method

GetScheme() static private method

Wrapper-safe method of getting the schema portion from an URL.
Invalid path.
static private GetScheme ( string path ) : string
path string A containing an URL or a local filesystem path.
return string
        internal static string GetScheme(string/*!*/ path)
        {
            int colon_index = path.IndexOf(':');

            // When there is not scheme present (or it's a local path) return "file".
            if (colon_index == -1 || Path.IsPathRooted(path))
                return "file";

            // Otherwise assume that it's the string before first ':'.
            return path.Substring(0, colon_index);
        }