public static bool TryParse(string value, out BlobPath path)
        {
            if (value == null)
            {
                path = null;
                return false;
            }

            int slashIndex = value.IndexOf('/');

            // There must be at least one character before the slash and one character after the slash.
            if (slashIndex <= 0 || slashIndex == value.Length - 1)
            {
                path = null;
                return false;
            }

            string containerName = value.Substring(0, slashIndex);
            string blobName = value.Substring(slashIndex + 1);

            path = new BlobPath(containerName, blobName);
            return true;
        }
Beispiel #2
0
        public static bool TryParse(string value, out BlobPath path)
        {
            if (value == null)
            {
                path = null;
                return(false);
            }

            int slashIndex = value.IndexOf('/');

            // There must be at least one character before the slash and one character after the slash.
            if (slashIndex <= 0 || slashIndex == value.Length - 1)
            {
                path = null;
                return(false);
            }

            string containerName = value.Substring(0, slashIndex);
            string blobName      = value.Substring(slashIndex + 1);

            path = new BlobPath(containerName, blobName);
            return(true);
        }