Getting last X characters from each line PowerShell

Viewed 37403

I'm trying to get the last 8 characters of every line of an array in the pipeline, I thought this would output the last 8 characters but the output seems to be blank

foreach($line in $Texfile) 
{
$line[-8..-1]-join ''
}
2 Answers
Related