Template talk:Csp

Add topic
From Meta, a Wikimedia project coordination wiki

Template:Csp, Template:Csp1, Template:Csp3, and Template:Csp4 are boolean functions of a parameter telling if it Contains a SPace.

The templates work by applying fullurl, which changes spaces into underscores, making the string different.

Various versions are possible, taking into account that fullurl discards trailing spaces and underscores, and that ifeq ignores leading and trailing spaces.

For the main version csp (first column of results on the right), a space at the start or at the end is also detected, and an underscore does not count as a space.

Adapted from w:en:Template:Sif.

abc //meta.wikimedia.org/wiki/Aabc [1] [2] 0 0 0 0
ab c //meta.wikimedia.org/wiki/Aab_c c [3] 1 1 1 1
 abc //meta.wikimedia.org/wiki/A_abc abc [4] 1 1 1 1
abc  //meta.wikimedia.org/wiki/Aabc [5] [6] 1 0 1 1
ab_c //meta.wikimedia.org/wiki/Aab_c [7] [8] 0 0 0 0
_abc //meta.wikimedia.org/wiki/A_abc [9] [10] 0 0 0 0
abc_ //meta.wikimedia.org/wiki/Aabc [11] [12] 0 1 1 1

Combining the results of colums 1, 2, and 3, trailing spaces and trailing underscores can each be separately detected.