Compatible Unicode Intrinsic Functions - Substring Method

Return part of a string

Member of Compatible Unicode Intrinsic Functions (PRIM_LIBI.ICompatibleUnicodeIntrinsics)

Parameters

Name

Type

Data Type

Description

Result

*Result (Optional)

Unicode String

Resulting string

StartPosition

*Input

Integer

Position at which to start the substring

Length

*Input (Optional)

Integer

Number of characters to substring

Pad

*Input (Optional)

Unicode String

Pad character used to replace blanks in the result

Details

Substring returns a section of the string starting at the specified StartPosition for a length of the specified Length. If this combination exceeds the available string length, Pad can be used to provide a pad character.

Example

In this example, if #String contained "ABCDE", the result would be "ABCD"

     #Com_owner.Caption := #String.Substring( 1 4) 

In this example, if #String contained "ABCDE", the result would be "ABCDE***"

     #Com_owner.Caption := #String.Substring( 1 8 ?*?)

See also

All Component Classes

Technical Reference