Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Str sub/doc: Difference between revisions

Template page
m remove error mentions that are no longer valid.
use {{TemplateBox}}, uses Lua, remove redundant category and interwikis already being in Wikidata
Line 1: Line 1:
{{Documentation subpage}}
{{Lua|Module:String}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{TemplateBox
  |1        = 1
  |1label-en= text
  |1d-en    = The text to get the substring from.
  |1aliases = <!-- List of aliases, separated by / (a slash) -->
  |1type    = <!-- number, string, string/wiki-user-name, string/wiki-page-name, string/line; unknown -->
  |1def    = <!-- default value for the parameter -->
  |1stat    = required


=== Usage ===
  |2        = 2
  |2label-en= start
  |2d-en    = Zero-based index of the first character returned.
  |2aliases =  
  |2type    = number
  |2def    = 0
  |2stat    = optional


<nowiki>{{str_sub|</nowiki>''text''|''start''|''length''<nowiki>}}</nowiki> = Substring of ''text'' starting at ''start'' and containing ''length'' characters. Base 0: the first character is numbered 0, and so on, e.g. <nowiki>{{str_sub|20090624130510|8|2}}</nowiki> returns the 2 characters starting at the 9th, i.e. "{{str_sub|20090624130510|8|2}}"
  |3        = 3
  |3label-en= length
  |3d-en    = The number of returned characters.
  |3aliases =
  |3type    = number
  |3def    = 0
  |3stat    = optional


Relies on [[Module:String]].
  |name              = Str sub long
 
  |desc              = This template returns the substring of <text> starting at <start> and containing <length> characters. Base 0: the first character is numbered 0, and so on, e.g. <nowiki>{{str sub long|20090624130510|8|2}}</nowiki> returns the 2 characters starting at the 9th, i.e. "{{str_sub|20090624130510|8|2}}".
=== See also ===
  |usage-notes        =
{{String templates see also}}
  |namespace          = template
<includeonly>
  |usergroup          =
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
  |shorthand          =
[[Category:String manipulation templates]]
  |mustbesubst        =  
 
  |setscats          =  
[[de:Vorlage:Str sub]]
  |placement          =  
[[en:Template:Str sub]]
  |example            =  
[[es:Plantilla:Str sub]]
  |example-value      =  
[[id:Templat:Str sub]]
  |relieson          =  
[[arz:قالب:Str sub]]
  |seealso            = {{String templates see also}}
[[ja:Template:Str sub]]
  |print              =
[[pt:Predefinição:Str sub]]
  |type              =
</includeonly>
  |i18n-method        = -
  |i18n-desc          =
  |i18n-subpage      =
  |i18n-mediawiki-msg =
  |useTemplateData    = only
}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.