aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/xpath/functions/substring/index.md
blob: c6b6a7929b981df6e8ffeff357b4501ef0c95953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: substring
slug: Web/XPath/Functions/substring
tags:
  - Référence_XSLT
translation_of: Web/XPath/Functions/substring
original_slug: Web/XPath/Fonctions/substring
---
{{ XsltRef() }}

La fonction `substring` retourne une partie d'une chaîne donnée.

### Syntaxe

    substring( chaîne , début [, longueur] )

### Arguments

- `chaîne`
  - : La chaîne à évaluer.

<!---->

- `début`
  - : La position dans la `chaîne` où commence la sous-chaîne.

<!---->

- `longueur` (optionnel)
  - : La longueur de la sous-chaîne à extraire. S'il est omis, la chaîne retournée contiendra tous les caractères depuis la position `début` jusqu'à la fin de la `chaîne`.

### Retour

Une chaîne.

### Notes

Comme pour les autres fonctions XPath, les positions ne sont pas comptées à partir de zéro. Le premier caractère de la chaîne est à la position 1.

### Définition

[XPath 1.0, section 4.2](http://www.w3.org/TR/xpath#function-substring).

### Support Gecko

Supportée.