12#ifndef INCLUDE_ARK_UTILS_HPP
13#define INCLUDE_ARK_UTILS_HPP
34 inline std::vector<std::string>
splitString(
const std::string& source,
char sep)
36 std::vector<std::string> output;
37 output.emplace_back();
44 output.emplace_back();
58 inline bool isDouble(
const std::string& s,
double* output =
nullptr)
61 double val = strtod(s.c_str(), &end);
62 if (output !=
nullptr)
64 return end != s.c_str() && *end ==
'\0' && val != HUGE_VAL;
Constants used by ArkScript.
std::vector< std::string > splitString(const std::string &source, char sep)
Cut a string into pieces, given a character separator.
int decPlaces(double d)
Count the number of decimals for a double.
int digPlaces(double d)
Count the number of digits for a double.
int levenshteinDistance(const std::string &str1, const std::string &str2)
Calculate the Levenshtein distance between two strings.
bool isDouble(const std::string &s, double *output=nullptr)
Checks if a string is a valid double.