title: How can i remove the part "http://" from a string?
body: <p>I have this method:</p>
  
  <pre><code>private List&lt;string&gt; offline(string targetDirectory)
  {
      if (targetDirectory.Contains("http://"))
      {
          MessageBox.Show("true");
      }
      DirectoryInfo di = new DirectoryInfo(targetDirectory);
      List&lt;string&gt; directories = new List&lt;string&gt;();
  
      try
      {
          string[] dirs = Directory.GetDirectories(targetDirectory,"*.*",SearchOption.TopDirectoryOnly);
          for (int i = 0; i &lt; dirs.Length; i++)
          {
              string t = "http://" + dirs[i];
              directories.Add(t);
          }
      }
      catch
      {
          MessageBox.Show("hgjghj");
      }
  
  
      return directories;
  
  }
  </code></pre>
  
  <p>This is the part:</p>
  
  <pre><code>if (targetDirectory.Contains("http://"))
  {
       MessageBox.Show("true");
  }
  </code></pre>
  
  <p>I'm getting a directory which give me all the directories in this directory and I'm adding to each directory the string <code>"http://"</code>.</p>
  
  <p>The problem is when next time a directory is getting to the function its coming with <code>"http://"</code></p>
  
  <p>For example: <code>http://c:\\</code> or <code>http://c:\\windows</code></p>
  
  <p>And then the line </p>
  
  <pre><code> DirectoryInfo di = new DirectoryInfo(targetDirectory); // throws exception.
  </code></pre>
  
  <p>So I want that each time a directory is getting to the function to check if it starts with <code>"http://"</code> in the beginning, strip the <code>"http://"</code> part, get all the directories, and then add to each directory <code>"http://"</code> like now.</p>
  
  <p>How can I remove <code>"http://"</code>?</p>