title: Accessing Blob Name(s) for a Azure Container without Regex
body: <p>I am trying to access just the Azure Blob's file name. For example if I am currently returning the string <code>privatecontainer/Text-pc.txt</code> and I am trying to just access the <code>Text-pc.txt</code>. The catch is that each Azure Container has different files within it. I have listed the code that I am using the generate a List of Blobs from a user specified Azure Container. </p>
  
  <p><strong>MainRun()</strong></p>
  
  <pre><code> public static void MainRun()
      {
          var userInput = GetContainerNameFromUser();
          CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("STORAGE_CONNECTION_STRING"));
  
          CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
  
          CloudBlobContainer container = blobClient.GetContainerReference(userInput);
  
          foreach (var blobItem in container.ListBlobs(useFlatBlobListing: true))
          {
            Console.WriteLine(blobItem.Parent.Uri.MakeRelativeUri(blobItem.Uri));
           // The line above for-loop will access all the Blobs within a Container
          }
      }
  </code></pre>
  
  <p>Is there a way to just access the <code>Text-pc.txt</code> without having to use regex? The reason I want to stay away from regex is that the <code>for</code> loop above successfully prints out the file name when there are Virtual Folders/Directories in place. However, on a Container that has Blobs without Virtual Folders/Directories it will print <code>publiccontainer/Text-pc.txt</code> i.e.<code>(&lt;container_name&gt;/File_name)</code>.</p>