Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Output the most common character from a QStringList?
Qt 6.11 is out! See what's new in the release blog

Output the most common character from a QStringList?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 173 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SOrton
    wrote on last edited by
    #1

    Hi,

    Basically, as title says i'm going to have a QStringList of characters for example:

    (x,x,x,b,b,b,b,b,r,r,g,g)

    Is there a simple function I can use to output 'b' (the most common value) from this list?

    Thanks!

    JonBJ 1 Reply Last reply
    0
    • S SOrton

      Hi,

      Basically, as title says i'm going to have a QStringList of characters for example:

      (x,x,x,b,b,b,b,b,r,r,g,g)

      Is there a simple function I can use to output 'b' (the most common value) from this list?

      Thanks!

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @SOrton
      Not (so far as I know) in a Qt library. Use the std:: library for this sort of functionality (or write it yourself).

      1 Reply Last reply
      0
      • S SOrton has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved