How do you get the last index of a character in a string in Lua?
"/some/path/to/some/file.txt"
How do I get the index of the last / in the above string?
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.
(Basically, find the position where the pattern “a forward slash, then zero or more things that aren’t a forward slash, then the end of the string” occurs.)