title: How to create a function in SQL Server
body: <p>Please help me, how to filter words in SQL using a function? </p>
  
  <p>I'm having a hard time if I explain it so I'm giving example:</p>
  
  <pre><code>ID       |       WebsiteName      |
  -----------------------------------
  1        |      www.yahoo.com     |
  2        |      www.google.com    |
  3        |      www.youtube.com   |
  </code></pre>
  
  <p>What I want is, how to get the name of the website. I want to select the record with an output like this. How to remove the 'www.' and '.com' in the record.</p>
  
  <pre><code>ID      |      WebsiteName
  --------------------------    
  1       |        yahoo
  </code></pre>
  
  <p>thanks for the help. :D</p>