int QString::indexOf ( const QString & str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) const
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. Returns -1 if str is not found.
C++ (Qt)
int num = 5;
QString str = "abcde5sgf";
int poz = str.indexOf(QString::number(num));