MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / findSubstringCaseInsensitive

Function findSubstringCaseInsensitive

source/MRMesh/MRString.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34{
35
36size_t findSubstringCaseInsensitive( const std::string& string, const std::string& substring )
37{
38 auto iter = std::search( string.begin(), string.end(),
39 substring.begin(), substring.end(),
40 [] ( char ch1, char ch2 )
41 {
42 return std::toupper( ch1 ) == std::toupper( ch2 );
43 } );
44 if ( iter == string.end() )
45 return std::string::npos;
46 return std::distance( string.begin(), iter );
47}
48
49int calcDamerauLevenshteinDistance( const std::string& stringA, const std::string& stringB,
50 bool caseSensitive, int* outLeftRightAddition )

Callers 3

searchMethod · 0.85
checkStringMaskMethod · 0.85
checkStringMaskMethod · 0.85

Calls 3

distanceFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected