6#ifndef THEORETICA_IO_STRINGS_H
7#define THEORETICA_IO_STRINGS_H
25 const std::string allowed =
"1234567890.,Ee+-Nnaif";
28 if (allowed.find(c) == std::string::npos)
40 inline std::string
trim(
const std::string& str) {
43 while (start < str.length() && std::isspace(str[start]))
46 size_t end = str.length();
47 while (end > start && std::isspace(str[end - 1]))
50 return str.substr(start, end - start);
58 inline std::string
unquote(
const std::string& str) {
60 if (str.length() >= 2 && str.front() ==
'"' && str.back() ==
'"')
61 return str.substr(1, str.length() - 2);
Input and output module.
Definition csv.h:23
bool is_number(const std::string &str)
Check if a given string could be correctly interpreted as a number.
Definition strings.h:20
std::string trim(const std::string &str)
Remove all leading and trailing whitespace from a string, returning the resulting string.
Definition strings.h:40
std::string unquote(const std::string &str)
Remove leading and trailing double quotes from a string, if both are present.
Definition strings.h:58
Main namespace of the library which contains all functions and objects.
Definition algebra.h:27