Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-107059

QString::replace: get match count

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 6.2.6
    • None
    • All

      It would be nice if the QString::replace methods had an additional optional output parameter to get the number of replacements, or a bool param to know if there is at least one match.

      Now, if I need to know if the string has changed, I have to call the QString::indexOf method before. This is not an optimal solution, because it requires 2 scans of the string.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            puffosauro Fabio Dago
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes