TableauServerUrls.GetProtocolFromUrl C# (CSharp) 메소드

GetProtocolFromUrl() 개인적인 정적인 메소드

private static GetProtocolFromUrl ( string url ) : string
url string
리턴 string
    private static string GetProtocolFromUrl(string url)
    {
        const string protocolIndicator = "://";
        int idxProtocol = url.IndexOf(protocolIndicator);
        if(idxProtocol < 1)
        {
            throw new Exception("No protocol found in " + url);
        }

        string protocol = url.Substring(0, idxProtocol + protocolIndicator.Length);

        return protocol.ToLower();
    }