Template:Str sub/doc
From MEpedia, a crowd-sourced encyclopedia of ME and CFS science and history
Purpose[edit source]
Extract the left characters of a string, starting part way through the string.
Usage[edit source]
Param | Name, Aliases | Description | Default | Required status | Example |
---|---|---|---|---|---|
1 | 1 | text string | 1def | Required | Random string... |
2 | 2 | start position | Required | 2 | |
3 | 3 | length (number of characters) | 3 | ||
{{Str sub|Level-headed|6|4}}
- head
Example[edit source]
{{Str sub|Level-headed|6|4}}:
- head
- Current 2 digit month:
{{Str sub|{{CURRENTTIMESTAMP}}|4|2}}:
- 03
{{Str sub|2014-03|5|2}}
:
- 03
- Combined with {{Str left}} to alter a date:
{{Str sub|2014-03|5|2}}-{{Str left|2014-03|4}}
- 03-2014
See also[edit source]
- {{Str left}} Left characters only
- {{Str find}}
- {{Right}} right align text
- String manipulation templates (category)
- Date and time templates (category)
- Formatting templates (category)