MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / StringFindLast

Function StringFindLast

Sources/Jazz2/Scripting/RegisterString.cpp:407–411  ·  view source on GitHub ↗

This function returns the index of the last position where the substring exists in the input string. If the substring doesn't exist in the input string -1 is returned. int string::findLast(const string &in sub, int start = 0) const

Source from the content-addressed store, hash-verified

405 //
406 // int string::findLast(const string &in sub, int start = 0) const
407 static std::int32_t StringFindLast(const String& sub, std::int32_t start, const String& str)
408 {
409 auto found = str.exceptSuffix(start).findLast(sub);
410 return (found != nullptr ? (std::int32_t)(found.begin() - str.begin()) : -1);
411 }
412
413 /*
414 // void string::insert(uint pos, const string &in other)

Callers

nothing calls this directly

Calls 3

findLastMethod · 0.45
exceptSuffixMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected