[PATCH] D104218: [ADT] Add StringRef consume_front_lower and consume_back_lower

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 11:00:20 PDT 2021


mstorsjo added a comment.

In D104218#2819837 <https://reviews.llvm.org/D104218#2819837>, @lattner wrote:

> I was thinking that the closure would take a character, not a stringref.  So you could do something like `str.consume_back(islower)`.

It's not about whether characters are lowercase or not, but whether the string ends with the given pattern, ignoring case. The `_lower` suffix is maybe a bit of a misnomer here, as it's not about lowercase itself but about case insensitivity, but it follows the existing pattern of `endswith_lower()` and `startswith_lower()`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104218/new/

https://reviews.llvm.org/D104218



More information about the llvm-commits mailing list