11#ifndef INCLUDE_ARK_UTILS_HPP
12#define INCLUDE_ARK_UTILS_HPP
31 inline std::vector<std::string>
splitString(
const std::string& source,
const char sep)
33 std::vector<std::string> output;
34 output.emplace_back();
36 for (
const char c : source)
41 output.emplace_back();
55 inline bool isDouble(
const std::string& s,
double* output =
nullptr)
58 const double val = strtod(s.c_str(), &end);
59 if (output !=
nullptr)
61 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.