Click to See Complete Forum and Search --> : search for strings inside ansistring


imin
November 30th, 2006, 02:59 AM
hi

i have this:


AnsiString test = "\1=this \2=is \3=all \4=test";

AnsiString another;


what should i do to search & put the, for example, 2=is into the variable another? the length of the ansistring test is variable.

thanks a lot

Calculator
November 30th, 2006, 03:03 AM
You can get a substring and check for equality, or convert it to a C or C++ string and functions for manipulating and comparing them.

dcjr84
November 30th, 2006, 04:20 AM
Get rid of the Borland compiler specific AnsiString and use the C++ std::string instead.

I think you will find it much more useful.

imin
November 30th, 2006, 04:40 AM
thanks a lot for helping.

however i used the ansistring pos function to search for the particular strings and it all worked well

thanks again