External tools

文字列の反転
文字列の反転 Bashにて

The GNU Linux core utilities contain lots of goodies. To reverse strings, use rev.

$ echo "Hello, World!" | rev
!dlroW ,olleH

rev also works with files to reverse each line.

$ printf '%s\n' one two three > myfile
$ rev myfile
eno
owt
eerht

There are other ways to do this, but none are a simple as rev.

grep -o . <<< "$string" | tac | paste -s -d ''
perl -lne 'print scalar reverse' <<< "$string"
# etc
2026年09月23日(水) · 役に立ちましたか?

Bashの文字列の反転に対する他のアプローチ

コミュニティがこの演習を解いた他の方法