StringAlgorithm.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #ifndef STRINGALGORITHM_H
  2. #define STRINGALGORITHM_H
  3. #include <string>
  4. #include <vector>
  5. namespace Utilities {
  6. namespace Internal {
  7. size_t find_nth(const std::string& haystack, size_t pos, const std::string& needle, size_t nth);
  8. } // namespace Internal
  9. bool equals(const std::string& str1, const std::string& str2);
  10. bool iequals(const std::string& str1, const std::string& str2);
  11. bool starts_with(const std::string& subject, const std::string& string);
  12. bool istarts_with(const std::string& subject, const std::string& string);
  13. std::vector<std::string> split(const std::string& subject, const char& delimiter);
  14. std::vector<std::string> split(const std::string& subject, const std::string delimiters);
  15. void erase_all(std::string& subject, const char& item);
  16. bool contains(const std::string& subject, const std::string& find);
  17. bool icontains(const std::string& subject, const std::string& find);
  18. std::string::const_iterator find_nth(const std::string& haystack, const std::string& needle, size_t nth);
  19. } // namespace Utilities
  20. #endif // STRINGALGORITHM_H