question

NicuF-5066 avatar image
0 Votes"
NicuF-5066 asked NicuF-5066 commented

PowerShell: Can turn more words in the line as if they were seen in the mirror?

hello. Can turn more words in the line as if they were seen in the mirror, using PowerShell?

For example:

On summer vacation it was great.

THE OUTPUT:

No remmus noitacav ti saw taerg.


windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered NicuF-5066 commented

Do you care about punctuation being considered a part of a word? Preservation of spaces (e.g. multiple spaces between words)? If not, then:

 $f = "On summer vacation it was great."
 $r = ""
 $f.split(' ') |
     ForEach-Object{
         for ($i = $_.Length-1; $i -ge 0; $i--){
             $r += $_[$i]
         }
         $r += " "
     }
 $r.trim()

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

works super, thank you @RichMatheisen-8856

0 Votes 0 ·