break could be added, so that we don't continue searching the string once we've found an index