.. _starts-with: =========== starts-with =========== Se uma string começa com outra Descrição ~~~~~~~~~ A função fn:starts-with devolve um xs:boolean que diz se uma string ($arg1) começa com os caracteres de outra ($arg2). Os espaços no início e no fim contam, então pode valer a pena usar fn:normalize-space para aparar as strings antes. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parâmetros** - **Descrição** * - arg1:string() - a string inteira a testar * - arg2:string() - o trecho a procurar * - collation:string() - a collation usada para comparar Exemplos ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Resultado** * - 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 Veja também ~~~~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`ends-with`. * :ref:`contains`.