Topic Path: Symbol Reference > Functions > TextStartsWith Function
ContentsIndexHome
PreviousUpNext
TextStartsWith Function

Checks for the specified substring at the beginning of the specified text.

File
function TextStartsWith(
    const S: string; 
    const SubS: string
): Boolean;
Parameters 
Description 
Text to be examined for the specified substring at its' origin.
 
SubS 
String to look for at the origin of the specified string. 

Boolean - True when the string begins with the specified substring.

TextStartsWith is a Boolean function used to determine if the text specified in S begins with the value specified in SubS. TextStartsWith is a convenience function that also encapsulates the platform- or OS-specific mechanisms require to perform the text comparision. 

 

For the .Net platform, TextStartsWith calls the Compare method in the System.String class using the indicated string and substring to perform a case-insensitive comparision. 

 

For the Windows operating system, the CompareString function in the Win32 API is called to perform a case-insensitive comparision. 

 

On the Linux platform, the AnsiCompareText method from the Sys class helper is called to perform a case-insensitive comparision. 

TextStartsWith returns True when the specified substring occurs at the beginning of the specified string. 

Use TextIsSame to perform a case-insensitive comparison for the entire contents of two string values.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.