Template:Str rightc/doc   

From Appropedia
Jump to: navigation, search
This is a documentation subpage for Template:Str rightc (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

Contents

[edit] Usage

{{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.

[edit] Limitations

  • Up to 100 chararacters in the input string. If possible, first check length of input string using {{Str len}}. Using strings longer than 100 characters may result in the error "max index is 100 for str_sub".
  • Limited set of characters.
  • Expensive (if used too many times per page, generates "Wikimedia Foundation Server Error").
  • Returning parameter 3, when parameter 1 is empty, was added 8 May 2010.

[edit] Examples

[edit] See also

Template:String templates see also


Wikipedia
This page or section includes content from Wikipedia. The original article was at Template:Str rightc. The list of authors can be seen in the history for that page. As with Appropedia, the text of Wikipedia is available under the CC-BY-SA.

Personal tools