Sign in Join
FPDoc Onlineexperiment

LazEndsText function

In unit LazStringUtils

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

Declaration

pascal
function LazEndsText(const ASubText: string; const AText: string)
: Boolean

Arguments

ASubText

Value to locate at the end of the string.

AText

String value used in the comparison.

Function result

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

Description

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

LazEndsText 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 at the end of the value in AText.

The return value is True when AText ends with the value in ASubText. The return value is True when ASubText is an empty string (''); this is Delphi compatible. It is False when StrLIComp returns a non-zero value, or when ASubText is longer than AText.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.