Remove the 'entry' from the 'list' using a case insensitive comparison. It returns true if found.
| 289 | // Remove the 'entry' from the 'list' using a case insensitive comparison. |
| 290 | // It returns true if found. |
| 291 | inline bool Remove(StringVec & list, const std::string & entry) |
| 292 | { |
| 293 | const auto it = std::find_if(list.begin(), list.end(), |
| 294 | [entry](const std::string & ent) |
| 295 | { |
| 296 | return Compare(ent.c_str(), entry.c_str()); |
| 297 | }); |
| 298 | if (it!=list.end()) |
| 299 | { |
| 300 | list.erase(it); |
| 301 | return true; |
| 302 | } |
| 303 | |
| 304 | return false; |
| 305 | } |
| 306 | |
| 307 | } // namespace StringUtils |
| 308 |