Example #1
0
			BOOTIL_EXPORT void FindAndReplace( BString& strIn, const BString& strFind, const BString& strReplace )
			{
				size_t pos = 0;
				while( ( pos = strIn.find( strFind, pos ) ) != std::string::npos )
				{
					strIn.replace( pos, strFind.length(), strReplace );
					pos += strReplace.length();
				}  
			}
Example #2
0
			BOOTIL_EXPORT void Split( const BString& str, const BString& seperator, String::List& outbits )
			{
				BString strBit;
				int iOffset = 0;
				int iLength = str.length();
				int iSepLen = seperator.length();

				int i = str.find( seperator, 0 );
				while ( i != std::string::npos )
				{
					outbits.push_back( str.substr( iOffset, i-iOffset ) );
					iOffset = i + iSepLen;

					i = str.find( seperator, iOffset );
				}

				outbits.push_back( str.substr( iOffset, iLength-iOffset ) );
			}