Template:MakeSimpleString
Jump to navigation
Jump to search
| Template:MakeSimpleString | {{MakeSimpleString
|string=
|var_name=
}} |
|
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:
- Change all letters to UPPERCASE.
- Remove punctuation marks including
.,!, and?. - Swap
:colons,-hyphens andspace* 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 $string Text 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