12#ifndef INCLUDE_ARK_UTILS_HPP
13#define INCLUDE_ARK_UTILS_HPP
32 inline std::vector<std::string>
splitString(
const std::string& source,
const char sep)
34 std::vector<std::string> output;
35 output.emplace_back();
37 for (
const char c : source)
42 output.emplace_back();
56 inline bool isDouble(
const std::string& s,
double* output =
nullptr)
59 const double val = strtod(s.c_str(), &end);
60 if (output !=
nullptr)
62 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.
ARK_API std::size_t 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.