Template:Remove first word/doc: Difference between revisions

From LPFM Wiki
Jump to navigation Jump to search
en>Vanisaac
m (→‎See also: clean up per WP:CAT#T and WP:AWBREQ add template:Sandbox other)
 
m (1 revision imported)
 
(No difference)

Latest revision as of 14:43, 30 July 2022

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

         | Template:Mbox
        }}{{#if: |
         |   {{#ifexist:Template:Remove first word
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

This template removes the first word of the first parameter. Use |{{SAFESUBST:#if:1|1=}} for the first parameter if the string may contain an equals sign (=). By default, words are delimited by spaces, but the optional parameter |{{SAFESUBST:#if:sep|sep=}} can set the separator to any character.

Usage

One parameter (space as separator):

  • {{Remove first word|string}}
  • {{Remove first word|1=string}}

Two parameters (user-defined character as separator):

  • {{Remove first word|string|sep=character}}
  • {{Remove first word|1=string|sep=character}}

Examples

  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). → bår bàz
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). → bår bàz
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). → b
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value).
  • Lua error in Module:Template_link_general at line 144: attempt to concatenate local 'titlePart' (a nil value). → bàz
  • {{Remove first word|Fôo-bår bàz|sep=-}} → bår bàz
  • {{Remove first word|34,000,500|sep=,}} → 000,500
  • {{Remove first word|Hear ye, users|sep=,}} → users
  • {{Remove first word|1=len = a+b|sep==}} → a+b

See also