PreviousNextIndex

SUBSTITUTE function

This function returns a character string that is made up of a base string plus the substitution of arguments in the string. It allows you to use a single string in place of concatenated strings. It is designed to simplify the task of translating an application from one language to another. This function is similar to the sprintf function in the C programming language.

Syntax

SUBSTITUTE ( base-string [ , arg ] ... ) 

base-string
arg
Examples

These statements display the same message:

MESSAGE SUBSTITUTE("There were &1 records in &2 tables",  
  rec-count, table-count). 

MESSAGE "There were" rec-count "records in"  
  table-count "tables". 

You can alter the position of the substitution parameters, as in this statement:

SUBSTITUTE("&2 comes before &1", "Friday", "Monday"). 

Notes
See also

REPLACE function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex