Wednesday, September 16, 2015

How to reverse string on Lubuntu


I just found out that on lubuntu/ubuntu we can reverse string/words, there is a program/tool to do that, in this article i will show you how to reverse string/words on lubuntu.

This feature is comes with lubuntu, so you don't need to install anything, you can go ahead try it from the command line/console, the program is called 'rev' stand for 'reverse'.

I guess having the ability to reverse string/words is quite useful for some people, specially for those who loves playing around with words.

Alright enough talking, show me how to do it, first you need to open the terminal/console on your lubuntu (press CTRL + ALT + T) and then type command 'rev', like this:

rev

Run the command and then you just type whatever string/words you want to reverse, hit enter and rev will reverse it for you, quite simple right?

The rev utility copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.

so basically 'rev' can take input from a file and it will automatically reverse character of each line on that file.

This tool can be useful for checking palindrome, palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers.

Some of well known palindrome:

  • Able was I ere I saw Elba
  • anna
  • amore roma
  • avid diva
  • aviva
  • arora
  • eve
  • hannah
  • harrah

No comments:

Post a Comment