-------------------------------------------------------------------------------- Description: Inserts insertStr after the last instance of afterSubstr in baseString. --------------------------------------------------------------------------------
| 25 | // Inserts insertStr after the last instance of afterSubstr in baseString. |
| 26 | // -------------------------------------------------------------------------------- |
| 27 | inline bool StringInsertStubAfter( std::string& baseString, const char* afterSubstr, const char* insertStr ) |
| 28 | { |
| 29 | size_t index = baseString.rfind( afterSubstr ); |
| 30 | if( index == std::string::npos ) |
| 31 | { |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | baseString.insert( index + strlen( afterSubstr ), insertStr ); |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | // -------------------------------------------------------------------------------- |
| 40 | // Description: |
no outgoing calls
no test coverage detected