String Intrinsic Functions - TrimSubstitute Method

Embed strings at specific substitution points (&1 &2 etc) trimming trailing blanks

Member of String Intrinsic Functions (PRIM_LIBI.ICommonStringIntrinsics)

Parameters

Name Type Data Type Description
Result *Result (Optional) String Resulting string
String1 *Input (Optional) String String to be embedded
String2 *Input (Optional) String String to be embedded
String3 *Input (Optional) String String to be embedded
String4 *Input (Optional) String String to be embedded
String5 *Input (Optional) String String to be embedded
String6 *Input (Optional) String String to be embedded
String7 *Input (Optional) String String to be embedded
String8 *Input (Optional) String String to be embedded
String9 *Input (Optional) String String to be embedded

Details

TrimSubstitute allows you to replace text at a series of predetermined points in a string, identified by &1 to &9, trimming all trailing blanks.

Example

In this example, *MtxtCust01 is a multilingual variable containing "&1 &2 has a limit of $&3"
 
#Givename, #Surname and #Limit have values of 'Veronica  ', 'Brown  ' and '2000' respectively.
 
The result at run time would be "Veronica Brown has a limit of $2000"
#Com_owner.caption := *MtxtCust01.Substitute(#Givename #Surname #Limit.AsString)
If two ampersands appear together in a string, they are reduced to a single ampersand and not considered for substitution.
 
In this example, #string will equal "a&2"
#string := ("&1&&2").TrimSubstitute( "a " "b " )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020