Template:First word/sandbox
This is the template sandbox page for Template:First word (diff). |
File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=Wikipedia:Lua | Uses Lua:
|
Usage
Returns the first word of the first parameter. By default, words are delimited by spaces, but optional parameter sep=/ can set the word separator to slash (or any other character). The parameter should not have leading spaces, unless the word separator, sep, is set to another character.
Examples
- {{first word|Foo bar baz}} → Foo
- {{first word|Foo}} → Foo
- {{first word|Foo-bar-baz}} → Foo-bar-baz
- {{first word|Foo-bar-baz|sep=- }} → Foo
- {{first word|34,000,500|sep=, }} → 34
- {{first word|1=len = a+b |sep== }} → len
- {{first word|Hear ye, users |sep=, }} → Hear ye
See also
Script error: The function "navbox" does not exist.
The above documentation is transcluded from Template:First word/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |