-------------------------------------------------------------------------------- Description: Inserts insertStr before the last instance of beforeSubstr in baseString. --------------------------------------------------------------------------------
| 9 | // Inserts insertStr before the last instance of beforeSubstr in baseString. |
| 10 | // -------------------------------------------------------------------------------- |
| 11 | inline bool StringInsertStubBefore( std::string& baseString, const char* beforeSubstr, const char* insertStr ) |
| 12 | { |
| 13 | size_t index = baseString.rfind( beforeSubstr ); |
| 14 | if( index == std::string::npos ) |
| 15 | { |
| 16 | return false; |
| 17 | } |
| 18 | |
| 19 | baseString.insert( index, insertStr ); |
| 20 | return true; |
| 21 | } |
| 22 | |
| 23 | // -------------------------------------------------------------------------------- |
| 24 | // Description: |
no outgoing calls
no test coverage detected