tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 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