;Turns "this" into "siht" StringReverse(String) { StringLen, L, String Loop, %L% { StringRight, StrRight, String, 1 StringTrimRight, String, String, 1 ResultString = %ResultString%%StrRight% } Return ResultString }
StringReverse
Started by
Invalid User
, Aug 22 2005 10:41 PM
3 replies to this topic
#1
-
Posted 22 August 2005 - 10:41 PM
my lame sig
loop, parse, String
From the "Loop (parse a string)" page in the manual:
Loop, Parse, InputVar [, Delimiters, OmitChars, FutureUse]
If this parameter [Delimiters] is blank or omitted, each character of InputVar will be treated as a separate substring.
This method utilizes AHk's builtin capabilities to parse and index individual characters within a string. Then build ResultString via prefixes in each iteration, rather than suffixes.
#2
-
Posted 23 August 2005 - 02:51 AM
Taking shimanovs idea, it would look like this:
StringReverse(String) { Loop, Parse, %String% ResultString = %A_LoopField%%ResultString% Return ResultString }*not tested*
#3
-
Posted 23 August 2005 - 10:32 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
Dang your absolutly right. And by the way, whats the 'manual'? :roll:
#4
-
Posted 23 August 2005 - 12:12 PM
my lame sig