title: Finding substring in string with forward slash in Powershell scripts
body: <p>I am trying to find sub-string in string using powershell script. Actually, I am reading a file line by line which contains thousands of paths. I am filtering each path coming from file. Path filters are finding sub-string in path.
  But <code>Contains</code> function returns false when sub-string is <code>Sroot</code> or <code>TRoot</code>. </p>
  
  <p>Following is my sample code.</p>
  
  <pre><code>foreach($line in Get-Content $filePath)
  {
      # Line can contain
      # $line = $/Patil/TEMP/PRoot/Digvijay/Patil/1.png 
      # $line = $/Patil/TEMP/SRoot/Digvijay/Patil/2.png
      # $line = $/Patil/TEMP/TRoot/Digvijay/Patil/3.png
      if($line)
      {        
          if($line.Contains('RRoot')) # This condition works properly
          {                       
              # Process Rroot here
          }                       
          if($line.Contains('SRoot')) # This condition fails.
          {
              # Process SRoot here
          }
          if($line.Contains('TRoot')) # This condition fails.
          {
              # Process TRoot here
          }
      }
   }
  </code></pre>
  
  <p><strong>Input file is like:</strong></p>
  
  <pre><code>$/Patil/TEMP/PRoot/Digvijay/Patil/1.png
  $/Patil/TEMP/SRoot/Digvijay/Patil/2.png
  $/Patil/TEMP/TRoot/Digvijay/Patil/3.png
  $/Patil/TEMP/WRoot/Digvijay/Patil/3.png
  </code></pre>