Stl search equivalent
-
Hi
Is there a Qt equivalent to the stl search algorithm?
I want to find sequences that occur ion other sequencesThanks for your time
-
-
If i read correctly these searches operate on a single value whereas I want to find a sequence of values
FOr example if my list isA B C D B C B C X Y Z
I want to find all occurrences of the sequence B C
-
Quote from the documentation link:
If STL is available on all your target platforms, you can use the STL algorithms instead of their Qt counterparts. One reason why you might want to use the STL algorithms is that STL provides dozens and dozens of algorithms, whereas Qt only provides the most important ones, making no attempt to duplicate functionality that is already provided by the C++ standard.So, use std::search, unless you have a good reason not to (then tell us your specific case)
-
indexOf of QString isn't good?
@
QString str = "We must be <b>bold</b>, very <b>bold</b>";
int j = 0;while ((j = str.indexOf("<b>", j)) != -1) {
qDebug() << "Found <b> tag at index position" << j;
++j;
}
@