Skip to content

Instantly share code, notes, and snippets.

@zachelko
Created April 2, 2010 19:39
Show Gist options
  • Save zachelko/353596 to your computer and use it in GitHub Desktop.
Save zachelko/353596 to your computer and use it in GitHub Desktop.
findAllOccurrences
QList<int> Hangman::findAllOccurrences(const QChar& theChar, const QString& theStr)
{
QList<int> occurrences;
for (int i = 0; i < theStr.size(); i++)
{
if (theStr.at(i).toUpper() == theChar.toUpper())
{
occurrences.push_back(i);
}
}
return occurrences;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment