title: Trim machine name from Hostinfo
body: <p>I want to trim the machine name from my Hostname so that I can get the server name.</p>
  
  <p>But I'm not able to figure out how.</p>
  
  <p>This is my code:</p>
  
  <pre><code> string machineName = System.Environment.MachineName;
   hostinfo = Dns.GetHostEntry(str); //Fetches the name of the system in the Network (SystemName.canon.co.in)   
   string Original = hostinfo.HostName.ToString();
  </code></pre>
  
  <p>Now the string contains the data like:</p>
  
  <pre><code>MachineName.ServerName
  blah.comp.co.uk
  </code></pre>
  
  <p>So I want to remove <code>blah.</code> from the string so that what I am left with is <code>comp.co.uk</code>.</p>
  
  <p>Can anyone help me out with it?</p>