Alternative to QString::sprintf()

  • So Gentlemen,

    How might I do the equivalent of this without using QString::sprintf ?


    please let me have your ideas.


  • Moderators

    Kenchan, for future reference, please try to open new posts rather than reopening ages-old ones. I'm going to move this question to its own thread for you.

    In your case, you could use something like:
    QString foo = QString("%1%2%3").arg(prefix).arg(intval).arg(suffix);
    or something. Be sure and look at the docs for QString.

  • OK, sorry about that. I was just searching for stuff and did not notice the date :-(.

    Thanks for your advice. I look into the arg() stuff in more detail.

  • Moderators

    Not a problem. Glad to help! If you have further questions, feel free to ask!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.