help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Procedures and functions] Reference for unit 'strings' (#rtl)

strlcomp

Compare limited number of characters of 2 null-terminated strings

Declaration

Source position: strings.pp line 50

function strlcomp(

  str1: pchar;

  str2: pchar;

  l: SizeInt

):SizeInt;

Description

Compares maximum L characters of the null-terminated strings S1 and S2. The result is

Errors

None.

See also

StrComp

  

Compare 2 null-terminated strings, case sensitive.

StrIComp

  

Compare 2 null-terminated strings, case insensitive.

StrLIComp

  

Compare limited number of characters in 2 null-terminated strings, ignoring case.

Example

Program Example8;

Uses strings;

{ Program to demonstrate the StrLComp function. }

Const P1 : PChar = 'This is the first string.';
      P2 : PCHar = 'This is the second string.';

Var L : Longint;

begin
  Write ('P1 and P2 are ');
  If StrComp (P1,P2)<>0 then write ('NOT ');
  write ('equal. The first ');
  L:=1;
  While StrLComp(P1,P2,L)=0 do inc (L);
  dec(l);
  Writeln (l,' characters are the same.');
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505