Template:Choptext
Jump to navigation
Jump to search
xxz
Template documentation
Uses Lua: |
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}} → aabbc
- {{choptext|My Film (film)| (}} → My 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.