Difference between revisions of "Template:UcWords"

From Epic Paths
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
-->{{#vardefine:b|{{#arraymap:{{#var:a}}|/|part|{{ucfirst:part}}|/}}}}<!--
-->{{#vardefine:b|{{#arraymap:{{#var:a}}|/|part|{{ucfirst:part}}|/}}}}<!--
-->{{#vardefine:c|{{#arraymap:{{#var:b}}|#|part|{{ucfirst:part}}|#}}}}<!--
-->{{#vardefine:c|{{#arraymap:{{#var:b}}|#|part|{{ucfirst:part}}|#}}}}<!--
-->{{#ifeq:{{#sub:{{#var:c}}|0|1}}|:|<!--
-->{{#vardefine:d|{{#arraymap:{{#var:c}}|:|part|{{ucfirst:part}}|:}}}}<!--
  -->{{#vardefine:d|&#x3A;{{#arraymap:{{#sub:{{#var:c}}|1}}|:|part|{{ucfirst:part}}|:}}}}|<!--
  -->{{#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: <nowiki>{{UcWords|main sub ter}}</nowiki> = {{UcWords|main sub ter}}


Line 15: Line 13:
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}}
'''(Note)''' Example: <nowiki>{{UcWords|main: sub}}</nowiki> = {{UcWords|main: sub}}
 
Example: <nowiki>{{UcWords|:main: sub}}</nowiki> = {{UcWords|:main: sub}}


Example: <nowiki>{{UcWords|templates,:Category:Combat}}</nowiki> = {{UcWords|templates,:Category:Combat}}
'''(Note)''' Example: <nowiki>{{UcWords|:Category:Combat}}</nowiki> = {{UcWords|:Category:Combat}}


Usage:  
Usage:  


<code><nowiki>{{</nowiki>UcWords|this:should be capitalized}}<noinclude></code>
<code><nowiki>{{</nowiki>UcWords|this:should be capitalized}}<noinclude></code>

Latest revision as of 15:58, 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

(Note) Example: {{UcWords|main: sub}} = Main:Sub

(Note) Example: {{UcWords|:Category:Combat}} = Category:Combat

Usage:

{{UcWords|this:should be capitalized}}