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) {
46 size_t end =
str.length();
47 while (end >
start && std::isspace(
str[end - 1]))
60 if (
str.length() >= 2 &&
str.front() ==
'"' &&
str.back() ==
'"')
61 return str.substr(1,
str.length() - 2);
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
Vector make_error()
Create a vector representing an error state, with all NaN values.
Definition algebra.h:103