MCPcopy Create free account
hub / github.com/p-ranav/tabulate / split_lines

Method split_lines

include/tabulate/format.hpp:517–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515 }
516
517 static std::vector<std::string> split_lines(const std::string &text, const std::string &delimiter,
518 const std::string &locale,
519 bool is_multi_byte_character_support_enabled) {
520 std::vector<std::string> result{};
521 std::string input = text;
522 size_t pos = 0;
523 std::string token;
524 while ((pos = input.find(delimiter)) != std::string::npos) {
525 token = input.substr(0, pos);
526 result.push_back(token);
527 input.erase(0, pos + delimiter.length());
528 }
529 if (get_sequence_length(input, locale, is_multi_byte_character_support_enabled))
530 result.push_back(input);
531 return result;
532 };
533
534 // Clears every field in `target` that is still identical to `previous`.
535 //

Callers

nothing calls this directly

Calls 3

get_sequence_lengthFunction · 0.70
findMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected