Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Help in constructing a QRegExp



  • I want to remove ".bmp" from my file name using QRegExp. My file name is formatted as "Alphanumerics.bmp".
    Could someone help me with constructing QRegExp for this?

    How can I use QRegExp for removing a part of QSting ?

    Regards,


  • Moderators

    @
    QString mystring("alphanumerics.bmp");

    mystring.replace(".bmp", "");
    @

    Done :) No need for regexp here. Alternatively, you can get the extension using QFileInfo::suffix().


Log in to reply