If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Assuming that I understand correctly what you're doing/asking, you should be able to get the portion of the string to search by using string = GetRange(0, GetInsertionPoint()); and then use rfind instead of find.
Assuming that I understand correctly what you're doing/asking, you should be able to get the portion of the string to search by using string = GetRange(0, GetInsertionPoint()); and then use rfind instead of find.
protocol wrote:In support to what DavidHart posted:
wxWidgets Doc wrote:
// rfind() family is exactly like find() but works right to left
// as find, but from the end
size_t rfind(const wxString& str, size_t nStart = npos) const;
// as find, but from the end
size_t rfind(const char* sz, size_t nStart = npos,
size_t n = npos) const;
// as find, but from the end
size_t rfind(char ch, size_t nStart = npos) const;