title: How to remove characters starting from X until the end
body: <p>I am looking for a function in <code>VB.NET</code> that will allow me to remove X until the end of the string</p>
  
  <p>Supposed <strong><code>X = ":"</code></strong>, this means that starting from <strong><code>:</code></strong> to the <code>end of the string</code> should be removed.</p>
  
  <p><strong>Example 1:</strong></p>
  
  <p>String: <code>Cary:Bondoc</code></p>
  
  <p>Result: <code>Cary</code></p>
  
  <p><strong>Example 2:</strong></p>
  
  <p>String: <code>192.168.111.111:23512</code></p>
  
  <p>Result: <code>192.168.111.111</code></p>