home *** CD-ROM | disk | FTP | other *** search
- program StringTest; {Test Strings Unit}
-
- {$X+}
-
- Uses Objects,TStrings;
-
- const
- UpperAlpha : array [0..26] of char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'#0;
- LowerAlpha : array [0..26] of char = 'abcdefghijklmnopqrstuvwxyz'#0;
- Numeric : array [0..10] of char = '0123456789'#0;
-
- var
- Test1 : pChar;
- Test2 : pChar;
- Test3 : pChar;
- St1 : array [0..1024] of char;
- St2 : array [0..1024] of char;
- res1 : integer;
- res2 : integer;
-
- begin
- StrCopy(@St1[0],@UpperAlpha[0]);
- StrCat(@St1[0],@LowerAlpha[0]);
- StrCopy(@St2[0],@UpperAlpha[0]);
- res1:=StrComp(@St1[0],@St2[0]);
- res1:=StrCSpn(@UpperAlpha[0],@LowerAlpha[0]);
- Test1:=StrECopy(@St2[0],@UpperAlpha[0]);
- Test2:=StrEnd(@St2[0]);
- Res1:=StrIComp(@St1[0],@St2[0]);
- StrLCopy(@St2[0],@Numeric[0],5);
- Res1:=StrLComp(@St2[0],@Numeric[0],5);
- StrLCat(@St2[0],@Numeric[0],7);
- Res1:=StrLen(@St2[0]);
- StrlCopy(@St2[0],@LowerAlpha[0],20);
- Res1:=StrLIComp(@st1[0],@St2[0],15);
- StrLower(@St1[0]);
- StrUpper(@St2[0]);
- StrMove(@St1[0],@St2[0],15);
- Test2:=StrNew(@LowerAlpha[0]);
- WriteLn(StrPas(Test2));
- StrPCopy(@St2[0],'Hello World');
- StrCat(@St1[0],@numeric[0]);
- Test1:=StrPos(@St1[0],@Numeric[0]);
- StrCopy(@st1[0],@St2[0]);
- StrPCopy(@St2[0],'l');
- Test1:=StrRScan(@St1[0],'l');
- StrDispose(test2);
- Test2:=StrScan(@St1[0],'l');
- StrPCopy(@St2[0],'HELLO World');
- Res1:=StrSpn(@St2[0],@UpperAlpha[0]);
- StrUpper(@St2[0]);
- end.