Does "this" start with "x"?
| 148 | |
| 149 | // Does "this" start with "x"? |
| 150 | bool starts_with(const StringPiece& x) const { |
| 151 | return x.empty() || |
| 152 | (size() >= x.size() && memcmp(data(), x.data(), x.size()) == 0); |
| 153 | } |
| 154 | |
| 155 | // Does "this" end with "x"? |
| 156 | bool ends_with(const StringPiece& x) const { |