Board index » cppbuilder » question about removing characters from a ansistring

question about removing characters from a ansistring


2006-08-31 03:11:03 AM
cppbuilder25
Hello,
I am wondering what is the best way to remove all the \r\n from a AnsiString? Is there some method that will go through it and remove just those characters?
 
 

Re:question about removing characters from a ansistring

"Nathan" < XXXX@XXXXX.COM >wrote in message
Quote
I am wondering what is the best way to remove all the \r\n from a
AnsiString?
If they are only at the very beginning and/or very end of the string, then
you can use the AnsiString's Trim(), TrimLeft(), and/or TrimRight() methods.
If they are in the middle of the string, however, than use the
StringReplace() function instead, or alternatively the AnsiString's Pos()
and Delete() methods in a loop.
Gambit