| 43 | } |
| 44 | |
| 45 | bool TryStripSuffixString(StringPiece str, const StringPiece& suffix, |
| 46 | string* result) { |
| 47 | const bool has_suffix = str.ends_with(suffix); |
| 48 | if (has_suffix) |
| 49 | str.remove_suffix(suffix.length()); |
| 50 | str.as_string().swap(*result); |
| 51 | return has_suffix; |
| 52 | } |
| 53 | |
| 54 | // ---------------------------------------------------------------------- |
| 55 | // StripString |