The strpos() function searches from the left side of the string. But instead of always trimming the string, I would like to get the position from the right side. Is there anyway to do this in the field calculator?
Here is the specific case of application:
I wanted to get the part of the string in "FolderPath" up the first '/' from the right.
Best Answer
I would use
regexp_substr
instead ofstrpos
so in your example something like:The first item (
"FolderPath"
) is your column name (enclosed in"
), the second is a standard python regular expression. There is a regexp howto available to help you out.