Difference between revisions of "Template:Str index/doc"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Import from Wikipedia (CC BY-SA license))
 
m (cull WP lang links)
 
Line 21: Line 21:
 
[[Category:String manipulation templates]]
 
[[Category:String manipulation templates]]
  
[[bg:Шаблон:Str index]]
 
[[de:Vorlage:Str index]]
 
[[es:Plantilla:Str index]]
 
[[id:Templat:Str index]]
 
[[ja:Template:Str index]]
 
[[ko:틀:Str index]]
 
[[pt:Predefinição:Str index]]
 
[[ru:Шаблон:Str index]]
 
[[sco:Template:Str index]]
 
[[sl:Predloga:Str index]]
 
 
</includeonly>
 
</includeonly>

Latest revision as of 13:33, 1 June 2015

Usage

{{str index|text|number}} = Returns the number-th character of text. Base 1: the first character is numbered 1, and so on.

Only supports a limited character set. Returns an error on unknown characters. Returns &#32; for a blank space.

The character set is A-Z, a-z, 0-9, space and !@#$%^&*().,<>:;[]'"?/\{}~`=-|+_♣♦♥♠. (Obviously | and = will have to have been input as {{!}} and {{=}}.)

Examples

  • {{str index|0123456789ABCDEF|15}} → E
  • {{str index|0123456789ABCDEF|18}} → <span id="FormattingError" />((str index)): String is not long enough.
  • {{str len|{{str index|a b|2}}}}}} → 5 (because the return is &#32; rather than a space character.)

See also

Description of all string templates