Clear-Host $Toto = "abcdefg" #La commande suivante affichera abcd Write-host $Toto.substring(0,$Toto.length -3) #La commande suivante affichera efg Write-host $Toto.substring($Toto.length -3)