I need to know how to retrieve the key set of a table in lua. for example, if I have the following table:
tab = {}
tab[1]='a'
tab[2]='b'
tab[5]='e'
I want to be retrieve a table that looks like the following:
keyset = {1,2,5}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that you cannot guarantee any order in
keyset. If you want the keys in sorted order, then sortkeysetwithtable.sort(keyset).