Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

ends_with

Summary

Checks if a string ends with a specific character/sequence.

Usage

input|ends_with( sequence )

Parameters

NameTypeDescriptionRequired
sequence string The string that should be matched. Yes.

Returns

TRUE if there is a match, FALSE otherwise.

Description

This operator checks if the input string ends with a specified sequence of characters. If yes, the operator returns TRUE, otherwise FALSE will be returned.

Examples

Example 1

{'Linux is great!'|ends_with( 'great!' )}

Returns TRUE.

Example 2

{'Linux is great!'|begins_with( 'Linux' )}

Returns FALSE.

Balazs Halasy (05/02/2004 10:54 am)

Ester Heylen (26/02/2010 2:37 pm)

Balazs Halasy, Ester Heylen


Comments

  • Typo in example ?

    Isn't the second example somewhat wrong as it uses the begins_with() operator instead of ends_with() ?