[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'LazStringUtils' (#lazutils)

LazStartsText

Determines if a string occurs at the beginning of the specified text.

Declaration

Source position: lazstringutils.pas line 42

function LazStartsText(

  const ASubText: string;

  const AText: string

):Boolean;

Arguments

ASubText

  

Value to locate at the start of the string.

AText

  

String value used in the comparison.

Function result

True when the sub-text is at the start of the string value.

Description

LazStartsText is a fast implementation of StartsText. The version in the RTL strutils.pp unit calls AnsiCompareText and is very slow.

LazStartsText casts the values in ASubText and AText to PChar types, and calls StrLIComp to perform a case-insensitive comparison for the number of characters in ASubText.

The return value is True when ASubText and AText start with the same values. The return value is also True when ASubText is an empty string (''); this is Delphi compatible. The return value is False when StrLIComp returns a non-zero value.

See also

StartsText

StrLIComp


Version 4.0 Generated 2025-05-03 Home