Google.GData.ContentForShopping.ContentForShoppingService.ParseService C# (CSharp) Method

ParseService() protected method

Parses the service name from a Content API URI endpoint.
protected ParseService ( string endpoint ) : string
endpoint string the endpoint of the request
return string
        protected string ParseService(string endpoint)
        {
            string baseUri = ContentForShoppingNameTable.AllFeedsBaseUri + "/";
            if (endpoint.StartsWith(baseUri)) {
                string remaining = endpoint.Substring(baseUri.Length,
                    endpoint.Length - baseUri.Length);

                // index 0 will be account id, index 1 will be service
                return remaining.Split('/')[1];
            }
            return "";
        }