Editing Template:Str right/doc
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
− | |||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | ||
− | == Usage == | + | === Usage === |
− | : {{ | + | : <code>{{Tlx|Str right|<string>|<offset>}}</code> |
Gives the characters from <offset> to the end of the string. | Gives the characters from <offset> to the end of the string. | ||
− | + | If <count> is invalid, empty or undefined, this template goes berserk, so don't do that. | |
− | If < | + | === Limitations === |
+ | * Up to 100 chararacters in the input string. If possible, first check length of input string using {{Tl|Str len|<string>}}. Using strings longer than 100 characters may result in the error '''''"<font color=#CC1100>max index is 100 for str_sub</font>"'''''. | ||
+ | * Limited set of characters. | ||
+ | * Expensive. | ||
− | + | === Examples === | |
− | + | *<tt><nowiki>{{Str right| lorem ipsum dolor sit amet | 10 }}</nowiki></tt> → {{Str right| lorem ipsum dolor sit amet | 10 }} | |
− | * < | + | *<tt><nowiki>{{Str right| lorem ipsum dolor sit amet | 1 }}</nowiki></tt> → {{Str right| lorem ipsum dolor sit amet | 1 }} |
− | * < | + | *<tt><nowiki>{{Str right| lorem ipsum dolor sit amet | 0 }}</nowiki></tt> → {{Str right| lorem ipsum dolor sit amet | 0 }} |
− | * < | + | *<tt><nowiki>{{Str right |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 | 99}}</nowiki></tt> → {{Str rightc |nocategory=true |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 | 99}} |
− | * < | ||
− | == | + | === See also === |
− | + | * {{Tl|Trunc|<string>|<count>}} - truncate right-side of string | |
− | {{ | + | * {{Tl|Str left|<string>|<count>}} - extract left-side substring |
− | < | + | * {{Tl|Str rightc|<string>|<count>}} - extract right-side of string |
− | + | * {{Tl|Str len|<string>}} - get numeric length of string (can be over 300 long) | |
− | + | * {{Tl|Title disambig text|<string>}} - Extract ''disambig'' from page titles of the form ''Title (disambig)'' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | * {{ | ||
− | * {{ | ||
− | |||
− | |||
− | |||
<includeonly> | <includeonly> | ||
− | <! | + | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> |
[[Category:String manipulation templates]] | [[Category:String manipulation templates]] | ||
− | [[ | + | [[es:Plantilla:Str right]] |
+ | [[id:Templat:Str right]] | ||
+ | [[it:Template:Str right]] | ||
+ | [[ja:Template:Str right]] | ||
+ | [[ru:Шаблон:Str right]] | ||
</includeonly> | </includeonly> |