الگو:نخستین واژه

{{{1}}}

توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

This template returns the first word of the first parameter. Use |1= for the first parameter if the string may contain an علامت مساوی (=). By default, words are delimited by spaces, but the optional parameter |sep= can set the separator to any character.

Usage ویرایش

One parameter (space as separator):

  • {{نخستین واژه|string}}
  • {{نخستین واژه|1=string}}

Two parameters (user-defined character as separator):

  • {{نخستین واژه|string|sep=character}}
  • {{نخستین واژه|1=string|sep=character}}

Examples ویرایش

  • {{نخستین واژه|Foo bar baz}} → Foo
  • {{نخستین واژه| Foo bar baz}} → Foo
  • {{نخستین واژه|Foo}} → Foo
  • {{نخستین واژه|Foo-bar-baz}} → Foo-bar-baz
  • {{نخستین واژه|Foo-bar-baz|sep=-}} → Foo
  • {{نخستین واژه|34,000,500|sep=,}} → 34
  • {{نخستین واژه|Hear ye, users|sep=,}} → Hear ye
  • {{نخستین واژه|1=len = a+b|sep==}} → len

See also ویرایش