Template:Str left
From FORwiki
(Difference between revisions)
(Created page with '<includeonly>{{padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude> {{pp-template}} {{documentation}} </noinclude>') |
|||
Line 2: | Line 2: | ||
{{pp-template}} | {{pp-template}} | ||
{{documentation}} | {{documentation}} | ||
+ | </noinclude> | ||
+ | <noinclude> | ||
+ | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Current revision as of 01:59, 3 December 2009
[edit] [ ]
Template documentation
![](/images/thumb/4/4c/Template-info.svg/50px-Template-info.svg.png)
Usage
{{Str left|<string>|<count>}}
Gives the <count> characters from the start of the string.
If <count> is invalid or empty, an empty string is returned. If undefined, it defaults to 1.
Examples
- {{Str left| lorem ipsum dolor sit amet | 10 }} →
- {{Str left| lorem ipsum dolor sit amet | 1 }} →
- {{Str left| lorem ipsum dolor sit amet | foo }} →
- {{Str left| lorem ipsum dolor sit amet | }} →
- {{Str left| lorem ipsum dolor sit amet }} →