Anonymous user
Module:String/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
→join: expand to explain about leading and trailing spaces in the separator; give examples
m (→count: c/e) |
(→join: expand to explain about leading and trailing spaces in the separator; give examples) |
||
Line 351:
; separator
: String that separates each string being joined together
: Note that leading and trailing spaces are ''not'' stripped from the separator.
; string1/string2/...
: Strings being joined together
Examples:
* <code><nowiki>"{{#invoke:String|join|x|foo|bar|baz}}"</nowiki></code> → "{{#invoke:String|join|x|foo|bar|baz}}"
* <code><nowiki>"{{#invoke:String|join||a|b|c|d|e|f|g}}"</nowiki></code> → "{{#invoke:String|join||a|b|c|d|e|f|g}}"
* <code><nowiki>"{{#invoke:String|join|,|a|b|c|d|e|f|g}}"</nowiki></code> → "{{#invoke:String|join|,|a|b|c|d|e|f|g}}"
* <code><nowiki>"{{#invoke:String|join|, |a|b|c|d|e|f|g}}"</nowiki></code> → "{{#invoke:String|join|, |a|b|c|d|e|f|g}}"
* <code><nowiki>"{{#invoke:String|join| – |a|b|c|d|e|f|g}}"</nowiki></code> → "{{#invoke:String|join| – |a|b|c|d|e|f|g}}"
The preceding example uses the html entity &ndash; but the unicode character also works.
== endswith ==
Usage:
|