Reversing text, is there a simple solution?

Posted by Desert_Wanderer on Fri 25 Jul 2003 04:34 PM — 5 posts, 19,780 views.

#0
Is there a simple solution to reversing text?

Example using the alias "backsay":
>backsay "this is a test"

would come out as: Player says, "tset a si siht"

I've been reading and searching for a method, but I haven't seen one yet. Thanks in advance.

-DW
#1
If you are using VBScript, you can do something like this


Dim test
test = StrReverse("this is a test")
Australia Forum Administrator #2
So, to put that into a ready-to-use alias:




<aliases>
  <alias
   match="backsay *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>Send "say " &amp; StrReverse ("%1")</send>
  </alias>
</aliases>



Example

backsay hi there
You say 'ereht ih'


Amended on Fri 01 Aug 2003 06:21 AM by Nick Gammon
#3
I received this error when I attempted to paste the alias.

Line 8: No closing ";" in XML entity argument "&" (problem in this file)

What's that mean?
Australia Forum Administrator #4
Sorry, I should have had &amp; rather than &.

I have fixed the post above, try again with the correction.