CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Posts
    141

    search for strings inside ansistring

    hi

    i have this:

    Code:
    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

  2. #2
    Join Date
    Aug 2005
    Posts
    478

    Re: search for strings inside ansistring

    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.
    Windows XP, Visual Studio 2008, SVN

  3. #3
    Join Date
    Sep 2005
    Location
    United States
    Posts
    799

    Re: search for strings inside ansistring

    Get rid of the Borland compiler specific AnsiString and use the C++ std::string instead.

    I think you will find it much more useful.
    Please rate my post if you felt it was helpful

  4. #4
    Join Date
    Jul 2005
    Posts
    141

    Re: search for strings inside ansistring

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured