It can additionally be an indication as to whether regular expression matching works, though that is usually handled by a library, and not the core string types.
My contention was always that if a "string" does not reverse text, then it's no better than an "array<char>". The existence of a "string" type implies it should do more.
It's more meaningless the more a naive algorithm is broken... But shouldn't it at least use those reverse letters Unicode has somewhere? Or is it just a matter of putting the right to left symbol at its start?
is a pretty common idiom in the shell when you want to keep "all but the last N chunks" from some lines of input.
At least for me. I'm sure there's probably a better way, and performance of this is definitely notably poor.
And of course it's not like I'm actually writing the utility. ;)
And for "drop the last X lines or words", you would do better with some specialized command.
(although if you are taking arbitrary user data I suppose there is nothing stopping you doing something stupid like putting an escaped '/' in a filename, which would break this.)