Difference between revisions of "Template:UcWords"

From Epic Paths
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|:{{#arraymap:{{#sub:{{#var:c}}|1}}|:|part|{{ucfirst:part}}|:}}}}|<!--
   -->{{#vardefine:d|&#x3A;{{#arraymap:{{#sub:{{#var:c}}|1}}|:|part|{{ucfirst:part}}|:}}}}|<!--
   -->{{#vardefine:d|dd{{#arraymap:{{#var:c}}|:|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:  
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>
Result: {{UcWords|this:should be capitalized}}

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}}