title: Split string with delimiter in sql server
body: <p>I'm having a coloumn name with varchar field that holds some folder path like "C:\Program Files\Internet Explorer\en-US" .I need to update the root folder name(Program files to profilesNew).Can anyone please help.
  I tried with a query </p>
  
  <pre><code>declare @val as varchar(100)
  set @val='C:\Program Files\Internet Explorer\en-US'
  
  select substring(@val,charindex(':\',@val),charindex('\',@val))
  </code></pre>
  
  <p>but not getting the exact answer</p>
  
  <pre><code>C:\Program FilesNew\Internet Explorer\en-US
  </code></pre>