tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
1
Task/Reverse-a-string/PowerShell/reverse-a-string-1.psh
Normal file
1
Task/Reverse-a-string/PowerShell/reverse-a-string-1.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
$s = "asdf"
|
||||
1
Task/Reverse-a-string/PowerShell/reverse-a-string-2.psh
Normal file
1
Task/Reverse-a-string/PowerShell/reverse-a-string-2.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
[string]::Join('', $s[$s.Length..0])
|
||||
1
Task/Reverse-a-string/PowerShell/reverse-a-string-3.psh
Normal file
1
Task/Reverse-a-string/PowerShell/reverse-a-string-3.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
-join ($s[$s.Length..0])
|
||||
1
Task/Reverse-a-string/PowerShell/reverse-a-string-4.psh
Normal file
1
Task/Reverse-a-string/PowerShell/reverse-a-string-4.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
[array]::Reverse($s)
|
||||
3
Task/Reverse-a-string/PowerShell/reverse-a-string-5.psh
Normal file
3
Task/Reverse-a-string/PowerShell/reverse-a-string-5.psh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$s -replace
|
||||
('(.)' * $s.Length),
|
||||
[string]::Join('', ($s.Length..1 | ForEach-Object { "`$$_" }))
|
||||
3
Task/Reverse-a-string/PowerShell/reverse-a-string-6.psh
Normal file
3
Task/Reverse-a-string/PowerShell/reverse-a-string-6.psh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$s -replace
|
||||
('(.)' * $s.Length),
|
||||
-join ($s.Length..1 | ForEach-Object { "`$$_" } )
|
||||
Loading…
Add table
Add a link
Reference in a new issue