Template:Strsub

ShoutWiki — express yourself and be heard!
Jump to navigation Jump to search
Template:Strsub invokes Module:String using Lua.

A subset of a string between one index and another

Use[edit source]

{{Strsub|string|start=index|end=index}}

string
the string whose substring to return
start
(optional, default: 1) the position of the first character to include; an integer between 1 and the length of the string; negative numbers specify a position from the end of the string
end
(optional, default: -1) the position of the last character to include; an integer between 1 and the length of the string; negative numbers specify a position from the end of the string

Example[edit source]

{{Strsub|abcde|start=2|end=4}}

produces

bcd