I have a string, and I need to find the last occurrence of any alphanumeric char in this string. Whichever the last alphanumeric character is in the string, I want that index. For
text="Hello World!- "
the output would be the index of 'd'
text="Hello02, "
the output would be the index of '2'. I understand I could do it in a 'brute force' kind of way, checking for every letter and every number and finding the highest index, but I'm sure there's a neater way to do it, but I can't find it.