Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for the best way to find the last occurrence of a character in a string.
Concrete example:
Out of this url: http://www.website.com/sub1/sub2/subx/suby/filename.jpg
I need to fetch:
"filename.jpg" as the result of the function.
The path before the filename can be different every time so I'm looking for a generic solution.
Any help would be greatly appreciated !
Kind regards,
Christophe
Index(URL,'/',-1) will return the position of the last "/" in the string.
mid(URL,Index(URL,'/',-1)+1) will return the filename and extension
Index(URL,'/',-1) will return the position of the last "/" in the string.
mid(URL,Index(URL,'/',-1)+1) will return the filename and extension
You could also do this:
=SubField(URL,'/',SubStringCount(URL, '/')+1)
URL being the field that has the URL in it
Perfect answer!