A way to remove a substring from a string. Proposed approach would be a second pipe after the filter. This way, the template explicitly states how the input string should be filtered and transformed prior to searching for the substring. This gives template authors a reliable format to match against (they can always use raw filter if they want the original string):
{{something|pascal|Something}} would remove "Something".
- "SomethingGrand" becomes "Grand"
- "something wonderful friend" becomes "WonderfulFriend"
Additionally, we could take the regex-y HTML attribute selector syntax from CSS (^ for "starts with" and $ for "ends with") and supplement with:
{{something|pascal|^Something}} only a starting instance of "Something"
{{something|pascal|$Something}} only an ending instance of "Something"
A way to remove a substring from a string. Proposed approach would be a second pipe after the filter. This way, the template explicitly states how the input string should be filtered and transformed prior to searching for the substring. This gives template authors a reliable format to match against (they can always use
rawfilter if they want the original string):{{something|pascal|Something}}would remove "Something".Additionally, we could take the regex-y HTML attribute selector syntax from CSS (
^for "starts with" and$for "ends with") and supplement with:{{something|pascal|^Something}}only a starting instance of "Something"{{something|pascal|$Something}}only an ending instance of "Something"