--- title: substring-before slug: Web/XPath/Functions/substring-before tags: - Référence_XSLT translation_of: Web/XPath/Functions/substring-before original_slug: Web/XPath/Fonctions/substring-before ---
{{ XsltRef() }}
La fonction substring-before()
retourne retourne la partie d'une chaîne donnée précédant une sous-chaîne donnée.
substring-before( bottedefoin , aiguille )
bottedefoin
aiguille
aiguille
dans la chaîne bottedefoin
sera retourné.
Une chaîne.
XPath Example | Output |
---|---|
<xsl:value-of select="substring-before('1999/04/01','/')" /> | 1999 |
substring-before('aa-bb','-') | aa |
substring-before('aa-bb','a') | (empty string) |
substring-before('aa-bb','b') | aa- |
substring-before('aa-bb','q') | (empty string) |
Supportée.
Interwiki Languages Links