我想在字符串中查找某些字符的位置,如"FC“或"FL”。对于FC这样的单个情况,我使用find()函数返回字符串中字符的索引,如下所示。for line in myfile:但是,在添加FL时,如何在不使用for循环中的if语句的情况下添加它呢?我不想增加多余的行,所以我希望有一个优雅的解决方案。
每一行将包括"FC“或"FL”,但两者都不包括。
setSingleShot(true);qDebug() << "remaining" << timer->remainingTime(); // this method is of course never fired, since the remaining time never reaches 0