| 16 | namespace toft { |
| 17 | |
| 18 | bool StringStartsWithIgnoreCase(const StringPiece& str, const StringPiece& prefix) |
| 19 | { |
| 20 | return str.size() >= prefix.size() && |
| 21 | memcasecmp(str.data(), prefix.data(), prefix.length()) == 0; |
| 22 | } |
| 23 | |
| 24 | // Replace the first "old" pattern with the "new" pattern in a string |
| 25 | std::string ReplaceFirst( |