Progress
Report Builder
User’s Guide


REPLACE-INDEXED

Replaces each occurrence of a substring with another string and returns the full string. REPLACE-INDEXED differs from the REPLACE function in that you identify the substring by specifying the start position and length instead of specifying the substring’s contents.

SYNTAX

REPLACE-INDEXED ( source-string , start , length , 
                  replace-string ) 

source-string

The character expression (a constant, field name, or expression that returns a character value) that you want to change. REPLACE-INDEXED does not change the value of the source string; only the return string contains the replacement.

start

The numeric expression representing the starting position of the replacement.

length

The numeric expression representing the number of characters of source-string you want to remove.

replace-string

The character expression (a constant, field name, or expression that returns a character value) that is the replacement expression.

NOTE

The length of replace-string does not have to be the same as length.

EXAMPLE

To change four characters of Prod-Code to BB, starting with the third character, create a calculated field containing this expression:

REPLACED-INDEXED(Prod-Code, 3, 4, "BB") 

Sample data:

Prod-code    REPLACED-INDEXED(Prod-Code,3,4,"BB")
JTddddT           JTBBT
JTdefgT           JTBBT 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095