Template:MakeSimpleString

From Disney•Pixar CARS Wiki
Jump to navigation Jump to search
Template:MakeSimpleString
{{MakeSimpleString
|string=
|var_name=
}}
Help

Perform various changes on an input string, to account for as many user input variables as possible: case sensitivity, special characters, and so on. Intended for maximizing aliasing in {{#switch:}} statements, without having to list every possible variation on every single branch.

Procedure as follows:

  1. Change all letters to UPPERCASE.
  2. Remove punctuation marks including ., !, and ?.
  3. Swap : colons, - hyphens and   space* characters with an _ underscore.

* Note the value is trimmed by default from the template pass, therefore the end and beginning never have something to modify.


Parameters
string$stringText input to modify.
string$var_name(optional) If specified, don't immediately return the result; store as a variable with the provided name.
Returns
Modified string -OR- variable (see $var_name above)

Used by