Further cleanup based on @daveshah1
This commit is contained in:
@@ -276,6 +276,12 @@ namespace RTLIL
|
||||
return std::string(c_str() + pos, len);
|
||||
}
|
||||
|
||||
bool begins_with(const char* prefix) const {
|
||||
size_t len = strlen(prefix);
|
||||
if (size() < len) return false;
|
||||
return substr(0, len) == prefix;
|
||||
}
|
||||
|
||||
bool ends_with(const char* suffix) const {
|
||||
size_t len = strlen(suffix);
|
||||
if (size() < len) return false;
|
||||
|
||||
Reference in New Issue
Block a user