PowerShell
On this publish, I’ll present the best way to reverse a string, i.e., the best way to change it from again to entrance. To spark some concepts on the best way to method this, I’ve offered just a few examples.
Get pleasure from exploring the chances!
# 1
$originalString = "Hiya, World!"
$reversedString = -join $originalString[-1..-($originalString.Length)]
Write-Host $reversedString
# 2
$string = 'Patrick'
-join $string.ToCharArray()[-1..-$string.Length]
# 3
-join 'Patrick'.ToChararray()[-1..-'Patrick'.Length]
# 4
$namen = 'Patrick','Herbert','Hans','Peter'
foreach ($identify in $namen) {
-join $identify.ToCharArray()[-1..-$name.Length]
}
# 5 # Out of Subject: Reverse Numbers
(1..100)[-1..-100] # oder 100..1
100..1
Hope this was useful.
Printed by

