get string s = string len = string.len out = "" for i = len-1; i < 0; i-- out += s[i] retrun out