| 331 | |
| 332 | template <typename ContainerType> |
| 333 | static inline bool ContainsSubString(const ContainerType& haystack, const std::string_view needle) |
| 334 | { |
| 335 | using ValueType = typename ContainerType::value_type; |
| 336 | if (needle.empty()) |
| 337 | return std::empty(haystack); |
| 338 | |
| 339 | return std::search(std::begin(haystack), std::end(haystack), reinterpret_cast<const ValueType*>(needle.data()), |
| 340 | reinterpret_cast<const ValueType*>(needle.data() + needle.length())) != std::end(haystack); |
| 341 | } |
| 342 | } // namespace StringUtil |