| 374 | } |
| 375 | |
| 376 | bool EatPrefix(std::string & s, std::string const & prefix) |
| 377 | { |
| 378 | if (!s.starts_with(prefix)) |
| 379 | return false; |
| 380 | |
| 381 | CHECK_LESS_OR_EQUAL(prefix.size(), s.size(), ()); |
| 382 | s = s.substr(prefix.size()); |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | bool EatSuffix(std::string & s, std::string const & suffix) |
| 387 | { |