|
- #include "llm.h"
-
- bool llm_isDigit(const std::string &str) {
- return
- !str.empty() &&
- str.find_first_not_of("0123456789") == std::string::npos;
- }
-
- bool llm_startsWith(
- const std::string &str,
- const std::string &prefix
- ) {
- // https://stackoverflow.com/a/40441240
- return str.rfind(prefix, 0) == 0;
- }
-
- int llm_strToInt(const std::string &str) {
- return std::stoi(str);
- }
|