Sign in Join
FPDoc Onlineexperiment

AnsiStartsStr function

In unit StrUtils

Check whether a string starts with a given substring, observing case.

Declaration

pascal
function AnsiStartsStr(const ASubText: AnsiString; 
 const AText: AnsiString): Boolean

Arguments

ASubText

Substring to check for.

AText

String to check in.

Function result

True if the given string starts with the substring, False if not.

Description

AnsiStartsStr checks AText to see whether it starts with ASubText , and returns True if it does, False if not. The check is performed case-sensitive. Basically, it checks whether the position of ASubText equals 1.

See also

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