Template:Nowordbreak/doc
Appearance
| Documentation subpage |
|---|
| View this documentation's related template: Template:Nowordbreak (edit). |
| Template styles: CSS styles (edit). |
This template will return the first n characters of a string, without breaking words. Numbers however, will be broken apart.
Note: This template requires the RegexFunctions extension and the Variables extension (whose future is uncertain).
Usage examples
[edit source]| Code | Gives |
|---|---|
{{nowordbreak|Testing, testing, 123|11}}
|
/[\W0-9]$/|Testing, te|{{#rmatch:Testing, tes|/[\W0-9]$/|Testing, te|{{#rmatch:Testing, te|/^(.*[\s]).*$/|$1|Testing, te}}}}}} |
{{nowordbreak|Testing, testing, 123|20}}
|
/[\W0-9]$/|Testing, testing, 12|{{#rmatch:Testing, testing, 123|/[\W0-9]$/|Testing, testing, 12|{{#rmatch:Testing, testing, 12|/^(.*[\s]).*$/|$1|Testing, testing, 12}}}}}} |