User:Mathglot/sandbox/Templates/Legifrance/prefix
Appearance
Documentation
For a given base code, supply an initial character 'L' to a string if it begins with a numeric; otherwise, return the string.
Usage
{{Legifrance/Prefix|string}}
Base codes affected are: CCOM, CEDU, CJA, CPEN, CTRANSP, and CT; there is no change for other base codes.
Parameters
There are two positional parameter.
|1=
– base code; optional (see table of codes) if omitted, defaults to no-change case
|2=
– string to examine; required
Examples
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CCOM|L420-2}} → L420-2
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CCOM|420-2}} → L420-2
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CCOM|D122-1}} → D122-1
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CCOM|122-1}} → L122-1
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CPEN|L133-2}} → L133-2
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CPEN|133-2}} → L133-2
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CEDU|L632-1}} → L632-1
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CEDU|632-1}} → L632-1
Examples with no prefix change:
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CC|1137}} → 1137
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CP|121-3}} → 121-3
- {{User:Mathglot/sandbox/Templates/Legifrance/prefix|CPP|62-2}} → 62-2