Home > Back-end >  O c string basic function
O c string basic function

Time:10-02

Just learning c + + Builder
Found it very complicated
c + + string functionsIn the Delphi string function is simple
Form1. Caption:=copy (' 123456789 ', 3, 6);//=345678

Form1. Text:=IntToStr (pos (' it ', 'fdgdit'));//=5 in the fifth word

Var st: string; The begin
St:='123456789'.
Delete (st, 2, 5);
Form4. Caption:=st;//=2345

Don't know if there is any c + + Builder copy pos Delete function
To be found that c + + function is complex
Wish everyone a detailed written

CodePudding user response:

D: form1. Caption:=copy (' 123456789 ', 3, 6);//=345678
C: Form1 - & gt; Caption=String (" 123456789 "). The SubString (3, 6);

D: form1. Text:=IntToStr (pos (' it ', 'fdgdit'));//=5 in the fifth word
C: Form1 - & gt; Fdgdit Text=IntToStr (String (" "), Pos (" it "));

Var st: string; The begin
St:='123456789'.
D: delete (st, 2, 5);
C: st=st. Delete (2, 5);

CodePudding user response:

They are like drops of
 form1 - & gt; Caption="1234567890"; 
Form1 - & gt; Caption=form1 - & gt; Caption. The SubString (3, 6);//substring
Form1. Text=form1 - & gt; Caption. Pos (" 56 ");//locate
Form1 - & gt; Caption=form1 - & gt; Caption. Delete (1, 2);//delete

CodePudding user response:

AnsiString class there are a lot of functions, quite rich

CodePudding user response:

This point c6 convenient than Delphi7,

To the later xe6, 7 as convenient

CodePudding user response:

C + + Builder on the string can also, in addition to the wide character support the poor
  • Related