10 6 58 Substring

LANSA Technical

10.6.58 Substring

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.

Input Parameters

StartPosition - Character at which to start the Substring

Length - number of characters to substring

Pad - Pad character to be used when length exceeds available string

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 '*')

 

Ý 10.6 Alphanumeric/String Intrinsic Functions