| 60 | */ |
| 61 | template<typename Needle> |
| 62 | QStringView leftOfLastNeedleOrEntireView(QStringView view, Needle needle) |
| 63 | { |
| 64 | const auto index = view.lastIndexOf(needle); |
| 65 | return index == -1 ? view : view.first(index); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Finds the last occurrence of @p needle in @p view and returns |