Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. public static string GetContainerNameFromFullPath(Uri blobClientBaseUri, string fullPath)
  2.         {
  3.             var offset = 1;
  4.             if(blobClientBaseUri.AbsoluteUri[blobClientBaseUri.AbsoluteUri.Length-1] == '/')
  5.             {
  6.                 offset = 0;
  7.             }
  8.             var relativePath = fullPath.Substring(blobClientBaseUri.AbsoluteUri.Length + offset);
  9.             return relativePath.Substring(0, relativePath.IndexOf('/'));
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement