GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing en.wikipedia.org — Template:String split - Wikipedia
Template:String split is a convenience wrapper for the The
Any double quotes (") in the separator parameter are stripped out, which allows spaces and wikitext like If the optional plain parameter is set to The index parameter is optional; it defaults to the first chunk of text. A negative parameter value counts chunks backward from the end of the text. Examples
Modules may return strings with | as separators like this:
Lua patterns can allow splitting at classes of characters such as punctuation:
Or split on anything that isn't a letter (no is treated as false):
Named parameters force the trimming of leading and trailing spaces in the parameters and are generally clearer when used:
A negative index will count back from the end of the text:
An easy mistake to make when using negative parameters is to forget that a trailing space in the text when passed as an unnamed parameter will induce an empty last chunk:
See alsoThe above documentation is transcluded from Template:String split/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Add categories to the /doc subpage. Subpages of this template. | ||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |