12#ifndef INCLUDE_ARK_UTILS_HPP
13#define INCLUDE_ARK_UTILS_HPP
30 inline std::vector<std::string>
splitString(
const std::string& source,
const char sep)
32 std::vector<std::string> output;
33 output.emplace_back();
35 for (
const char c : source)
40 output.emplace_back();
54 inline bool isDouble(
const std::string& s,
double* output =
nullptr)
57 const double val = strtod(s.c_str(), &end);
58 if (output !=
nullptr)
60 return end != s.c_str() && *end ==
'\0' && val != HUGE_VAL;
std::vector< std::string > splitString(const std::string &source, const char sep)
Cut a string into pieces, given a character separator.
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.