title: Extract a substring
body: <p>I am trying to get proper error message which is there in description. But when my debugger enters into <code>substring</code> line its getting exited with no reason.</p>
  
  <pre><code>$job= submitting the job 2fdab2d5-f09c-4392-953e-8b85f90d76eb ... 
        client version: 10.2.2.0 
        target: cluster 
        stat: simulatelarge 
        skippath: true error submitting job.  
        vcclientexceptions.vcclientexception: [httpstatuscode = 0; description = e_csc_user_syntaxerror: syntax error. expected one of:_all _and ';' ')' ','  
        description: invalid syntax found in the script. 
        resolution: correct the script syntax, using expected token(s) as a guide.... at token [output], line 13 near the ###: 
  
  $descpos = $job.IndexOf("description:")
  $resopos = $job.IndexOf("resolution:")
  
  $descmsg = $descmsg.Substring($descpos) 
  Write-Host $descmsg
  $ferrormsg = $job.Substring($msgpos,$respos+1)
  Write-Host $ferrormsg 
  </code></pre>
  
  <p>WORKING - CODE:</p>
  
  <pre><code> [string]$Result=$job
              $Result= $Result -Replace "[\{]|(\{)|[\}]|(\})|[\""]|(\"")",''
              $msgpos = $Result.IndexOf(("message:") )           
              $resopos = $Result.IndexOf(("resolution:") )            
              $descpos = $Result.IndexOf(("description:") )                
              $ferrormsg = $Result.Substring($msgpos,($descpos-$msgpos) ) 
              $ferrormsg = $ferrormsg -Replace "(\,)|(\')|(\-)|(\=)",''
  
              Write-Host $ferrormsg
  </code></pre>
  
  <p>THANKS ALL ,
  Replaceing my string is working fine. </p>