title: Error with Substring()
body: <pre><code>$fileName = "Name of TheFolder_NE_ED"
  $lengthFileName = $fileName.length
  $shortenLengthFileName = $lengthFileName - 5
  Write-Host("Name of TheFolder_NE_ED").Substring($shortenLengthFileName,$lengthFileName)
  $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
  </code></pre>
  
  <p>I am having a problem with <code>SubString()</code> function, it errors with:</p>
  
  <p><a href="https://i.stack.imgur.com/iJUmG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iJUmG.png" alt="error message"></a></p>
  
  <p>I tried printing out values of my variables but they seemed fine.</p>