Warcraft III resources & community, 2003–2006 · archived

StringReverse

not rated
Submitted by KaTTaNaText Parsing0 downloads
Returns the string backwards.
For example:
StringReverse("The Jass Vault") == "tluaV ssaJ ehT"

Source

function StringReverse takes string s returns string
    local integer i = 1
    local string result = ""
    local string t

    loop
        set t = SubString(s, i-1, i)
        exitwhen (t == "") or (t == null)

        set result = t + result
        set i = i + 1
    endloop

    return result
endfunction

Comments

0

No comments.