SAND CDBMS Tools Reference Guide
NDL++ Functions:
Syntax and Examples


Return to String Function Index

 

String Function Syntax and Examples


REPLACE( )

The REPLACE() function replaces a substring within a string.

Syntax:

REPLACE(string,string-to-find,string-to-replace [,count [,[CASEINSENS | 0] | [CASESENS | 1] ] ] )  

where:

Example:

input: samplestring

IMPORT @sample.dat
{

RECORD
{
field1 *\r\n
}
schema1.table1
{
col1 REPLACE(field1,'sample','my')
col2 REPLACE(field1,'string','data')
col3 REPLACE('','sample','my')
col4 REPLACE(field1,'','my')
col5 REPLACE(field1,'sample','')
col6 REPLACE(field1,'s','',1)
}

}


Results:

schema1.table1.col1 mystring
schema1.table1.col2 sampledata
schema1.table1.col3 ''
(empty string
, length=0)
schema1.table1.col4 samplestring
schema1.table1.col5 string
schema1.table1.col6 amplestring

 

Return to String Function Index