Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>reverse() - reverse a string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     reverse() - reverse a string
  Usage:    <string> = reverse(<string>)
  Params:   string <string> - the string to reverse
  Returns:  a string equal to the reverse of <string>

 ---------------------------------- Example ---------------------------------

                 * check if a word is a palindrome
                 @ 10,0 say "Enter a word :" get m_word
                 read
                 if alltrim(m_word) == reverse(alltrim(m_word))
                      @ 20,0 say "The word is a palindrome!"
                 else
                      @ 20,0 say "The word is not a palindrome"
                 endif

  Hint:     If you are using the readh() function for Hebrew input,
            you can use reverse() to correctly index those right to
            left character strings.


See Also: ljust() rjust()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson