55 size_t start =
in.find_first_not_of(
" \t");
56 size_t end =
in.find_last_not_of(
" \t");
57 if (start == std::string::npos)
58 return std::string(
"");
60 return in.substr (start, end-start+1);
67 std::transform (
in.begin(),
in.end(), out.begin(),
tolower);
74 std::string out =
trim (
in);
75 std::string
out2 (out);
76 std::transform (out.begin(), out.end(),
out2.begin(),
tolower);
84 return range.first == std::string::npos &&
range.second == std::string::npos;
92 static std::pair<size_t, size_t>
102 return make_pair (string::npos, string::npos);
105 const size_t first =
str.find_first_not_of (
delimiters, start);
106 if (first == string::npos)
108 return make_pair (string::npos, string::npos);
109 else if (first == size-1)
122 std::vector<std::string>
127 std::vector<std::string>
tokens;
int size(const Comm< Ordinal > &comm)
Get the number of processes in the communicator.
Concrete serial communicator subclass.
Matrix Market file utilities.
static std::pair< size_t, size_t > nextToken(const std::string &str, const std::string &delimiters, const size_t start, const size_t size)
static bool endToken(const std::pair< size_t, size_t > &range)
Does range signify "no more tokens"?
std::vector< std::string > split(const std::string &str, const std::string &delimiters, const size_t start)
Split the given string using the given set of delimiters.
std::string lowercase(const std::string &in)
Return lowercase version of the given string.
std::string trim_and_lowercase(const std::string &in)
Trim whitespace from both sides, and make lowercase.
std::string trim(const std::string &in)
Trim whitespace from both sides of the given string.
Teuchos implementation details.