Expression Language
Also available as:
PDF

replace

Description: Replaces all occurrences of one literal String within the Subject with another String.

Subject Type: String

Arguments:

  • Search String : The String to find within the Subject

  • Replacement : The value to replace Search String with

Return Type: String

Examples: If the "filename" attribute has the value "a brand new filename.txt", then the following Expressions will provide the following results:

Table 1.8. Table 8. Replace Examples

Expression

Value

${filename:replace('.', '_')}

a brand new filename_txt

${filename:replace('', '.')}

a.brand.new.filename.txt

${filename:replace('XYZ', 'ZZZ')}

a brand new filename.txt

${filename:replace('filename', 'book')}

a brand new book.txt