I have the following string type:
file:///private/var/mobile/Containers/Data/Application/1C02189F-2426-4420-A178-1CC420CBBD3A/tmp/com.test.Test-Inbox/2015-04-23_00002.jpg
And I need to access the file extension which in this case is .jpg
I want to access the string after the last .
since it will always be the file extension I want, but I cannot substring it to the last 3 chars because the extension might have 4 chars like .docx
or .mpeg
What would be the best way to do this?
I thought in reverse the string and loop char by char to get the latest (in this case first) .
and then as I find the length I could substring it.
Any thoughts?
Thanks