20 #ifndef UTILS_STRINGS_FIND_ALL_OF_H
21 #define UTILS_STRINGS_FIND_ALL_OF_H
27 inline std::vector<size_t>
FindAllOf(
const std::string &haystack,
28 const std::string &needle) {
29 std::vector<size_t> instances;
30 size_t pos = haystack.find(needle, 0);
32 while (pos != std::string::npos) {
33 instances.push_back(pos);
34 pos = haystack.find(needle, pos + 1);
39 inline std::vector<size_t>
FindAllOf(
const std::string &haystack,
char needle) {
40 const std::string needle_string = { needle };
41 return FindAllOf(haystack, needle_string);
std::vector< size_t > FindAllOf(const std::string &haystack, const std::string &needle)