• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Str Nth slash

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation

Return Nth expression split by slash, or 1st item, if no N index given.

Usage

{{str Nth slash|3|String one / two / and three}}

Parameters

  • |1= – the N index; if N=2, returns the second expression (i.e., after the first slash). Default: 1; alias: |N=.
  • |2= – a string, optionally containing slash separators (with or without leading/trailing blanks, which are ignored)

Examples

  • {{str Nth slash|2|one / two / and three}} ⟶ two
  • {{str Nth slash|1|one two three}} ⟶ one two three
  • {{str Nth slash|2|one two three}} ⟶
  • {{str Nth slash|3|one / two / and three}} ⟶ and three
  • {{str Nth slash|7|one / two / and three}} ⟶
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Str_Nth_slash&oldid=31693"
Last edited on 5 February 2022, at 03:37

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 5 February 2022, at 03:37.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop