Unicode Intrinsic Functions - Substitute Method

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

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)

Parameters

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

Details

Substitute allows you to replace text at a series of predetermined points in a string, identified by &1 to &9.
 
If two ampersands appear together in a string, they are reduced to a single ampersand and not considered for substitution.

Example

In this example, *MtxtCust01 is a multilingual variable containing the following "&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)
In this example, #string will equal "a&2"
#string := ("&1&&2").Substitute( "a " "b " )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020