title: How To Remove Last Word With Slash In A Textbox VB.NET
body: <p>I'm trying to remove the last word on a <code>Label</code> with it's slash without putting it in a <code>String</code> or an <code>Array</code> because the words are typed, looks something like this <code>D:\Folder1\Folder2\Folder3\Folder4</code> and if i click a button it should remove the <code>Folder4</code> and when i click the button again it should remove the <code>Folder3</code> and so on.</p>
  
  <pre><code>Dim s As String = Label5.Text
  Dim r As String = Replace(s, "\", "")
  Label5.Text = r
  </code></pre>
  
  <p>And this only removes the slash, how do i add the texts?
  I tried something like this:</p>
  
  <pre><code>Replace(s, "\" &amp; Label5.Text.TrimEnd, "")
  </code></pre>
  
  <p>but nothing happens. Help?</p>