Add str_startswith

This commit is contained in:
2026-04-17 22:56:34 +08:00
parent 12a4b29061
commit 52878e53b2
2 changed files with 15 additions and 0 deletions

View File

@@ -60,6 +60,13 @@ namespace str_util {
* @return true if input ends with pattern
*/
bool str_endswith(std::string input, std::string pattern);
/**
* @brief Check if a string starts with a pattern
* @param input Input data
* @param pattern Pattern
* @return true if input starts with pattern
*/
bool str_startswith(std::string input, std::string pattern);
/**
* @brief Trim a string
* @param input Input string