I use stata for some of my data analysis. I wanted to ask how to go about solving this problem: I would like to return the last distinct substring in a given string.
For example, given a string: "orange, banana, melon, cocoa, cocoa" you'll agree that the last distinct substring is cocoa which is the result I want.
Also, we could have string like: "orange,cocoa, banana, orange, orange" and I would like to return the index of the last stable substring (i.e. orange because there was no other subtring that appear after orange at the end of the string ) in the string
I look forward to your response.
Many thanks,
For example, given a string: "orange, banana, melon, cocoa, cocoa" you'll agree that the last distinct substring is cocoa which is the result I want.
Also, we could have string like: "orange,cocoa, banana, orange, orange" and I would like to return the index of the last stable substring (i.e. orange because there was no other subtring that appear after orange at the end of the string ) in the string
I look forward to your response.
Many thanks,
Comment