ഫലകം:Str left

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.
Documentation icon Template documentation[view] [edit] [history] [purge]

ഉള്ളടക്കം

Usage[തിരുത്തുക]

{{Str left|<string>|<count>}}

Gives the <count> substring of characters from the start of the string (the substring has length <count>).

If <count> is invalid or empty, an empty string is returned. If undefined, it defaults to 1.

Limitations[തിരുത്തുക]

  • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
  • Inexpensive (uses no other templates).

Examples[തിരുത്തുക]

  • {{Str left| Lorem ipsum dolor sit amet | 10 }} → Lorem ipsu
  • {{Str left| Lorem ipsum dolor sit amet | 1 }} → L
  • {{Str left| Lorem ipsum dolor sit amet | 0 }}
  • {{Str left| Lorem ipsum dolor sit amet | }}
  • {{Str left| Lorem ipsum dolor sit amet }} → L
  • {{Str left| Lorem ipsum dolor sit amet | 40 }} → Lorem ipsum dolor sit ametLorem ipsum do

See also[തിരുത്തുക]

  • {{Trunc}} - truncate right-side of string
  • {{Str right}} - extract remainder of string
  • {{Str rightc}} - extract right-side of string
  • {{Str len}} - get numeric length of string (can be over 300 long)
"http://ml.wikipedia.org/w/index.php?title=ഫലകം:Str_left&oldid=1951295" എന്ന താളിൽനിന്നു ശേഖരിച്ചത്