The loop condition may as well be <code> (count < max - 1 && StringMatch...) </code>, saving the need for this check.