// Copyright 2023 Google LLC. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #include "string_trim_split.h" #include namespace shaka { std::vector SplitAndTrimSkipEmpty(const std::string& str, char delimiter) { auto tokens = absl::StrSplit(absl::AsciiStrToLower(str), delimiter, absl::SkipEmpty()); std::vector results; for (const absl::string_view& token : tokens) { std::string trimmed = std::string(token); absl::StripAsciiWhitespace(&trimmed); if (!trimmed.empty()) { results.push_back(trimmed); } } return results; } } // namespace shaka