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

Function StringFindLastOf

Sources/Jazz2/Scripting/RegisterString.cpp:375–379  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

373 //
374 // int string::findLastOf(const string &in sub, uint start = 0) const
375 static std::int32_t StringFindLastOf(const String& sub, std::uint32_t start, const String& str)
376 {
377 auto found = str.exceptSuffix(start).findLastAny(sub);
378 return (found != nullptr ? (std::int32_t)(found.begin() - str.begin()) : -1);
379 }
380
381 /*
382 // This function returns the index of the first position where a byte other than those in substring

Callers

nothing calls this directly

Calls 3

findLastAnyMethod · 0.45
exceptSuffixMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected