MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / first_word

Function first_word

highs/util/stringutil.cpp:122–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122std::string first_word(std::string& str, size_t start) {
123 // If start is (at least) the length of str, then next_word_start is
124 // negative, so there's no word, so return ""
125 if (start >= str.length()) return "";
126 const std::string chars = "\t\n\v\f\r ";
127 size_t next_word_start = str.find_first_not_of(chars, start);
128 size_t next_word_end = str.find_first_of(chars, next_word_start);
129 assert(next_word_start != std::string::npos);
130 return str.substr(next_word_start, next_word_end - next_word_start);
131}

Callers 10

parseDefaultMethod · 0.85
parseRowsMethod · 0.85
parseColsMethod · 0.85
parseRhsMethod · 0.85
parseBoundsMethod · 0.85
parseRangesMethod · 0.85
parseQuadRowsMethod · 0.85
parseQuadMatrixMethod · 0.85
parseConesMethod · 0.85
parseSosMethod · 0.85

Calls 1

substrMethod · 0.80

Tested by

no test coverage detected