sanjoy added a subscriber: sanjoy. sanjoy added a comment. Have you considered adding `StringRef(iterator, iterator)` constructor, and replacing the explicit loops with `std::find_if` and `std::find_if_not`. https://reviews.llvm.org/D24842