std::string_view sv{"11;22;;;55;6;777;;;;"}; std::string_view delim{";"}; std::vector<std::string_view> values; for (auto && word : std::views::split(sv, delim) | std::views::filter([&](const auto & v) {return !v.empty(); })) { values.emplace_back(std::string_view(word.data(), word.size())); }