MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Split

Method Split

include/tvm/ffi/string.h:748–760  ·  view source on GitHub ↗

! * \brief Split the string by a delimiter character. * \param delim The delimiter character. * \return A vector of string_views pointing into this string's data. * \note The returned string_views are only valid while this String is alive. */

Source from the content-addressed store, hash-verified

746 * \note The returned string_views are only valid while this String is alive.
747 */
748 std::vector<std::string_view> Split(char delim) const {
749 std::vector<std::string_view> ret;
750 const char* start = data();
751 const char* end = start + size();
752 for (const char* p = start; p < end; ++p) {
753 if (*p == delim) {
754 ret.emplace_back(start, static_cast<size_t>(p - start));
755 start = p + 1;
756 }
757 }
758 ret.emplace_back(start, static_cast<size_t>(end - start));
759 return ret;
760 }
761
762 private:
763 template <typename, typename>

Callers 1

TESTFunction · 0.80

Calls 1

emplace_backMethod · 0.45

Tested by 1

TESTFunction · 0.64