Expression Language
Also available as:
PDF

substringBefore

Description: Returns a portion of the Subject, starting with the first character of the Subject and ending with the character immediately before the first occurrence of the argument. If the argument is not present in the Subject, the entire Subject will be returned.

Subject Type: String

Arguments:

  • value : The String to search for in the Subject

Return Type: String

Examples: If the "filename" attribute has the value "a brand new filename.txt", then the following Expressions will result in the following values:

Table 1.3. Table 3. SubstringBefore Examples

Expression

Value

${filename:substringBefore('.')}

a brand new filename

${filename:substringBefore('')}

a

${filename:substringBefore(' n')}

a brand

${filename:substringBefore('missing')}

a brand new filename.txt