PreviousNextIndex

REPLACE function

Returns a string with specified substring replacements.

Syntax

REPLACE ( source-string , from-string , to-string ) 

source-string
from-string
to-string
Example

The following example uses the REPLACE function to replace the string “user” with an actual user ID, if available:

r-repl.p
DEFINE VARIABLE greeting AS CHARACTER NO-UNDO FORMAT "x(40)" 
  INITIAL "Starting user’s session . . . ". 
IF USERID("DICTDB") < > "" THEN  
  greeting = REPLACE(greeting, "user", USERID("DICTDB")). 
DISPLAY greeting WITH NO-LABELS. 

Notes
See also

OVERLAY statement, SUBSTITUTE function, SUBSTRING function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex