2#ifndef THEORETICA_IO_STRINGS_H
3#define THEORETICA_IO_STRINGS_H
21 const std::string
allowed =
"1234567890.,Ee+-Nnaif";
24 if (
allowed.find(c) == std::string::npos)
36 inline std::string
trim(
const std::string&
str) {
42 size_t end =
str.length();
43 while (end >
start && std::isspace(
str[end - 1]))
56 if (
str.length() >= 2 &&
str.front() ==
'"' &&
str.back() ==
'"')
57 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:16
std::string trim(const std::string &str)
Remove all leading and trailing whitespace from a string, returning the resulting string.
Definition strings.h:36
std::string unquote(const std::string &str)
Remove leading and trailing double quotes from a string, if both are present.
Definition strings.h:54
Main namespace of the library which contains all functions and objects.
Definition algebra.h:27
TH_CONSTEXPR Type make_error()
Create a number representing an error state, constructed from a NaN value.
Definition real_analysis.h:1322