Template:Choptext

From Holocron - Star Wars Combine
Jump to: navigation, search


The Template:Choptext chops, or truncates, a text string in parameter 1 at a specified character, such as "[" or at substring in parameter 2. If the specified substring is not found, then the whole string is returned, unchopped.

Usage:   {{choptext|abcdef|d}} → abc
{{choptext|aabbccddee|cd}} →
{{choptext|My Film (film)| (}} →
{{choptext|No Parentheses| (}} → No Parentheses

If no match is found, then the entire string is returned unchopped. The chop character defaults to a left square bracket "[" as in a hidden category link.