.. _contains: ======== contains ======== Whether one string contains another Description ~~~~~~~~~~~ The fn:contains function returns true if $arg1 contains the characters of $arg2 anywhere in its contents, including at the beginning or end. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg1:string() - the string to test * - arg2:string() - the substring to test for * - collation:string() - the collation to use for sorting Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - contains('query', 'e') - true * - contains('query', 'ery') - true * - contains('query', 'query') - true * - contains('query', 'x') - false * - contains('query', '') - true * - contains('query', ()) - true * - contains( (), 'q') - false See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_contains-word`. * :ref:`functx_contains-case-insensitive`. * :ref:`functx_contains-any-of`. * :ref:`functx_index-of-string`. * :ref:`functx_index-of-string-first`. * :ref:`functx_index-of-string-last`. * :ref:`starts-with`. * :ref:`ends-with`. * :ref:`matches`.