Template:Str index/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎See also: Unicodifying, replaced: see also → See also)
m (→‎top: clean up, replaced: {{Documentation subpage → {{Doc/subpage)
 
Line 1: Line 1:
{{Documentation subpage}}
{{Doc/subpage}}
{{Wikipedia port|old=434795244|documentation=1}}
{{Wikipedia port|old=434795244|documentation=1}}
<!-- Please place categories where indicated at the bottom of this page -->
<!-- Please place categories where indicated at the bottom of this page -->

Latest revision as of 02:28, 12 January 2024

Edit-copy.png
This is a documentation subpage for Template:Str index.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

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.

Template:Str character set documentation

Examples

  • {{str index|0123456789ABCDEF|15}} → E
  • {{str index|0123456789ABCDEF|18}}((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

Template:String templates See also