String Intrinsic Functions - LeftMost Method
Get the left most characters from the string
Member of String Intrinsic Functions (PRIM_LIBI.ICommonStringIntrinsics)

Parameters

Name

Type

Data Type

Description

Result

*Result (Optional)

String

Resulting characters

Characters

*Input (Optional)

Integer

Number of characters to return

Pad

*Input (Optional)

String

Pad character used to replace blanks in the result

Details


LeftMost returns the first n characters of a string. If the string does not have enough characters, the remaining space can be padded.

Example


In this example, if #String contained ABCDEFGHIJKLMNOPQRSTUVWXYZ, the result would be ABCDEFGHIJKLM
#Com_owner.Caption := #String.LeftMost( 13 )
In this example, if #String contained ABCDEFGHI the result would be ABCDEFGHI****
#Com_owner.Caption := #String.LeftMost( 13 "*" )

See also

All Component Classes
Technical Reference