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

Method substr

include/tvm/ffi/string.h:655–661  ·  view source on GitHub ↗

! * \brief Returns a substring [pos, pos+count) * \param pos The position of the first character to include * \param count The length of the substring (default: until end of string) * \return A string containing the substring */

Source from the content-addressed store, hash-verified

653 * \return A string containing the substring
654 */
655 String substr(size_t pos = 0, size_t count = npos) const {
656 if (pos > size()) {
657 throw std::out_of_range("tvm::String substr index out of bounds");
658 }
659 size_t rcount = std::min(count, size() - pos);
660 return String(data() + pos, rcount);
661 }
662
663 /*!
664 * \brief Check if the string starts with a prefix

Callers 3

ParseCustomDataTypeCodeFunction · 0.80
TESTFunction · 0.80
modifyPassConfigMethod · 0.80

Calls 1

StringClass · 0.70

Tested by 1

TESTFunction · 0.64