Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Reverse-a-string/AutoHotkey/reverse-a-string-1.ahk
Normal file
8
Task/Reverse-a-string/AutoHotkey/reverse-a-string-1.ahk
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
MsgBox % reverse("asdf")
|
||||
|
||||
reverse(string)
|
||||
{
|
||||
Loop, Parse, string
|
||||
reversed := A_LoopField . reversed
|
||||
Return reversed
|
||||
}
|
||||
19
Task/Reverse-a-string/AutoHotkey/reverse-a-string-2.ahk
Normal file
19
Task/Reverse-a-string/AutoHotkey/reverse-a-string-2.ahk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Reverse(String){ ; credit to Rseding91
|
||||
If (A_IsUnicode){
|
||||
SLen := StrLen(String) * 2
|
||||
VarSetCapacity(RString,SLen)
|
||||
|
||||
Loop,Parse,String
|
||||
NumPut(Asc(A_LoopField),RString,SLen-(A_Index * 2),"UShort")
|
||||
} Else {
|
||||
SLen := StrLen(String)
|
||||
VarSetCapacity(RString,SLen)
|
||||
|
||||
Loop,Parse,String
|
||||
NumPut(Asc(A_LoopField),RString,SLen-A_Index,"UChar")
|
||||
}
|
||||
|
||||
VarSetCapacity(RString,-1)
|
||||
|
||||
Return RString
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue