MCPcopy Create free account
hub / github.com/KDE/kdevelop / leftOfLastNeedleOrEntireView

Function leftOfLastNeedleOrEntireView

kdevplatform/util/stringviewhelpers.h:62–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60 */
61template<typename Needle>
62QStringView 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

Callers 1

buildMethod · 0.85

Calls 1

firstMethod · 0.45

Tested by

no test coverage detected