.. _starts-with: =========== starts-with =========== Whether one string starts with another Description ~~~~~~~~~~~ The fn:starts-with function returns an xs:boolean value indicating whether one string ($arg1) starts with the characters of another string ($arg2). Leading and trailing whitespace is significant, so you may want to use the fn:normalize-space function to trim the strings before using this function. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg1:string() - the entire string to test * - arg2:string() - the substring to check for * - collation:string() - the collation to use for comparing Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - starts-with('query', 'que') - true * - starts-with('query', 'query') - true * - starts-with('query', 'u') - false * - starts-with('query', '') - true * - starts-with('', 'query') - false * - starts-with('', '') - true * - starts-with('query', ()) - true * - starts-with(' query', 'q') - false See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`ends-with`. * :ref:`contains`.