wxString Find next? Topic is solved

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.
Post Reply
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

wxString Find next?

Post by gtafan »

wxString has void Find (const wxString &sub), which is described in the docu. I gues that void returns the first apearence of sub, but what if sub apears more than 1 time? How to find the other apearences of sub? Something like FindNext() would be helpful, but haven´t found anything with similar functionality.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxString Find next?

Post by PB »

You probably need to use find() which uses a start parameter and call the method in a loop, using the previous result increased by one.

Pretty much the same as in here: https://stackoverflow.com/a/4034809/7267315
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: wxString Find next?

Post by gtafan »

PB wrote:You probably need to use find() which uses a start parameter and call the method in a loop, using the previous result increased by one.

Pretty much the same as in here: https://stackoverflow.com/a/4034809/7267315
Thanks, Didn´t noticed that function in the docu, as it was not in the list of search and replace functions. Should search more precise in the docu next time.
Post Reply