Modèle:str rightc
Apparence
Documentation du modèle
- Cette documentation est incluse depuis Modèle:str rightc/Documentation. [rafraîchir] · [modifier] · [historique]
Usage
[modifier le wikicode]{{str rightc|<string>|<count>}}
{{str rightc|<string>|<count>|<result if empty>}}
Gives a substring of length <count> of characters from the right-side end of the string. If the parameter 1 <string> is empty, then immediately returns with parameter 3 (or nothing), and skips all the complex processing usually needed to extract a substring.
If <count> is invalid, empty or undefined, this template goes berserk, so don't do that.
Limitations
[modifier le wikicode]- Returning parameter 3, when parameter 1 is empty, was added 8 May 2010.
Examples
[modifier le wikicode]{{str rightc| lorem ipsum dolor sit amet | 10 }}
→ r sit amet{{str rightc| lorem ipsum dolor sit amet | 1 }}
→ t{{str rightc| lorem ipsum dolor sit amet | 0 }}
→{{str rightc| | 1 | empty }}
→ empty{{str rightc |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 | 99}}
→ 3456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1