Difference between revisions of "Template:UcWords"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
-->{{#vardefine:c|{{#arraymap:{{#var:b}}|#|part|{{ucfirst:part}}|#}}}}<!-- | -->{{#vardefine:c|{{#arraymap:{{#var:b}}|#|part|{{ucfirst:part}}|#}}}}<!-- | ||
-->{{#ifeq:{{#sub:{{#var:c}}|0|1}}|:|<!-- | -->{{#ifeq:{{#sub:{{#var:c}}|0|1}}|:|<!-- | ||
-->{{#vardefine:d| | -->{{#vardefine:d|:{{#arraymap:{{#sub:{{#var:c}}|1}}|:|part|{{ucfirst:part}}|:}}}}|<!-- | ||
-->{{#vardefine:d| | -->{{#vardefine:d|{{#arraymap:{{#var:c}}|:|part|{{ucfirst:part}}|:}}}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->{{#var:d}}<!-- | -->{{#var:d}}<!-- | ||
--></includeonly><noinclude>Capitalize every word in the text. Considers spaces, /, # and : as seperators. | --></includeonly><noinclude>Capitalize every word in the text. Considers spaces, /, # and : as seperators. | ||
Example: <nowiki>{{UcWords|main sub ter}}</nowiki> = {{UcWords|main sub ter}} | |||
Example: | Example: <nowiki>{{UcWords|main/sub ter}}</nowiki> = {{UcWords|main/sub ter}} | ||
Example: <nowiki>{{UcWords|main#sub ter}}</nowiki> = {{UcWords|main#sub ter}} | |||
Example: <nowiki>{{UcWords|main: sub}}</nowiki> = {{UcWords|main: sub}} | |||
Example: <nowiki>{{UcWords|:main: sub}}</nowiki> = {{UcWords|:main: sub}} | |||
Usage: | |||
<code><nowiki>{{</nowiki>UcWords|this:should be capitalized}}<noinclude></code> | <code><nowiki>{{</nowiki>UcWords|this:should be capitalized}}<noinclude></code> | ||
Revision as of 15:27, 6 August 2021
Capitalize every word in the text. Considers spaces, /, # and : as seperators. Example: {{UcWords|main sub ter}} = Main Sub Ter
Example: {{UcWords|main/sub ter}} = Main/Sub Ter
Example: {{UcWords|main#sub ter}} = Main#Sub Ter
Example: {{UcWords|main: sub}} = Main:Sub
Example: {{UcWords|:main: sub}} = :Main:Sub
Usage:
{{UcWords|this:should be capitalized}}