ANSI string is a type used in most VCL forms. Contrary to the following documentation, the type ANSIString is declared using the type String (defined in classes.hpp) , as opposed to string (from
String myReadLine(istream &in)
{
long int eoln;
char inval[255];
char *ptr;
do
{
in.getline(inval,255);
ptr = strchr(inval,'\0');
eoln = ptr -inval;
} while (!eoln && !in.eof());
return String(inval);
}
This function is not associated with any class, so you can import it anytime you need it.
C++Builder implements the AnsiString type as a class. AnsiString is designed to function like the Delphi long string type. Accordingly, AnsiString provides the following string handling characteristics which are required when you call VCL-type functions that use any of the Delphi long string types.
If you don’t provide an initial value, AnsiString variables are initialized to zero upon instantiation.
~AnsiString AnsiCompare AnsiCompareIC AnsiLastChar AnsiPos AnsiString ByteType c_str CurrToStr CurrToStrF Delete FloatToStrF FmtLoadStr Format FormatFloat Insert IntToHex IntToHex IsDelimiter IsEmpty IsLeadByte IsPathDelimiter IsTrailByte LastDelimiter Length LoadStr LowerCase operator != operator [] operator + operator += operator < operator <= operator = operator == operator > operator >= Pos SetLength StringOfChar SubString ToDouble ToInt ToIntDef Trim TrimLeft TrimRight TStringMbcsByteType Unique UpperCase WideChar WideCharBufSize