Template:Str Nth slash
Appearance
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}}⟶