title: Cutting a string Until a particular character occurs
body: <p>whats the code to cut or trim a string until a particular character is hit.</p>
  
  <p>for example,</p>
  
  <pre><code>dim TestString as String = "REG - REGULAR"
  </code></pre>
  
  <p>output of this string after cutting should be, </p>
  
  <pre><code>"REG" 
  </code></pre>
  
  <p>The code should be able to cut the string until it reaches this character "-". </p>
  
  <p>It should also remove the white spaces.
  whats the code for doing this task.</p>
  
  <p>I am using vb.net.</p>
  
  <p>Thank You</p>