Revision as of 06:16, 20 February 2025 by Prd(talk | contribs)(Created page with "{{Documentation subpage}} {{Lua|Module:String}} <!----PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE----> :'''''Please see: ''{{ml|string|sub|section=#sub}}.''' == Usage == <code><nowiki>{{str sub old|</nowiki>''text''|''start''|''length''<nowiki>}}</nowiki></code> = Substring of ''text'' starting at ''start'' and containing ''length'' characters. Zero-indexed: the first character is numbered 0, and so on, e.g. <nowiki>{{str sub old|20090624130510|8|2}}...")
{{str sub old|text|start|length}} = Substring of text starting at start and containing length characters. Zero-indexed: the first character is numbered 0, and so on, e.g. {{str sub old|20090624130510|8|2}} returns the 2 characters starting at the 9th, i.e. "13".
Examples
{{str sub old|1234567|3|2}} —> 45
{{str sub old| alphabet|0|5}} —> alpha
{{str sub old| alphabet|5|999}} —> bet
{{str sub old|alph abet|0|5}} —> alph
{{str sub old| three words here |4|10}} —> e words h
Any leading spaces are skipped, but internal spaces are counted exactly, yet compressed when displayed.