junrushao commented on code in PR #388:
URL: https://github.com/apache/tvm-ffi/pull/388#discussion_r2670058881
##########
include/tvm/ffi/string.h:
##########
@@ -655,6 +655,60 @@ class String {
return String(data() + pos, rcount);
}
+ /*!
+ * \brief Check if the string starts with a prefix
+ * \param prefix The prefix to check for
+ * \return true if the string starts with prefix, false otherwise
+ */
+ bool startswith(const String& prefix) const { return
startswith(prefix.data(), prefix.size()); }
Review Comment:
maybe prefer `std::string_view`? It doesn't copy the string and seems a
standardized interface to work with
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]