Template:PropVals/Split
From Salem Wiki
Head
Template documentation (for the template shown above, sometimes hidden or invisible)
Description
- This template is used to split the parts of a property's value using a separator.
- See these pages for documentation on functions used:
Syntax
- Type the below code somewhere on a page:
{{PropVals/Split}}
- It can accept 3 named-parameters:
- val
- Mandatory; The value to split. Defaults to "Head;Middle;Tail"
- part
- Optional; The part to fetch, and can be:
- 'head' = Fetch first part. (default)
- 'tail' = Fetch last part.
- a number = Fetch the #part, this number is directly used by the #explode: function and is Zero-based as explained in its documentation.
- Optional; The part to fetch, and can be:
- sep
- Optional; The separator to use for splitting parts. (defaults to a dot-colon ';')
- val
Examples
- {{PropVals/Split}} and {{PropVals/Split|part=head}} gives:
Head and Head - {{PropVals/Split|part=-1}} and {{PropVals/Split|part=tail}} gives:
Tail and Tail - {{PropVals/Split|part=1}} gives:
Tail - {{PropVals/Split|val=A:B:C|sep=:}} gives:
A - {{PropVals/Split|val=A:B:C|sep=:|part=1}} gives:
B - {{PropVals/Split|val=A:B:C|sep=:|part=tail}} gives:
C
Visit Template:PropVals/Split/doc to edit this text! (How does this work?)