Using indexOf() I am able to prepend the required character only to the first occurrence of the RegExp in myString. How can I do the same for all the occurrences??
Using indexOf() I am able to prepend the required character only to the first occurrence of the RegExp in myString. How can I do the same for all the occurrences??
This does not work if there are multiple occurrences of the same RegExp and it is not even known how amny times a particular RegExp would occur. How can I find multiple occurrences and make the required change??
did you see this example?
Qt Code:
QStringList list; int pos = 0; while ((pos = rx.indexIn(str, pos)) != -1) { list << rx.cap(1); pos += rx.matchedLength(); }To copy to clipboard, switch view to plain text mode
Thanks works now!!![]()
Bookmarks