টেমপ্লেট:Str find0/নথি

উইকিপিডিয়া, মুক্ত বিশ্বকোষ থেকে

The Template:str_find0 returns first appearance of a substring in a string, otherwise returns -1.
This template uses sub-template:str sub find which does the routine.

ব্যবহার[সম্পাদনা]

{{str find0|<string1>|<string2>}}

  • It is zero-based. So no need for extra {{#expr:{{str find|}}-1}} calculations to use it in other templates.

সীমাবদ্ধতা[সম্পাদনা]

  • Handles strings up to 90 characters.

সম্পাদন[সম্পাদনা]

  • Very fast on short strings. Uses enhanced algorithm to run the subroutine only when needed.

উদাহরণ[সম্পাদনা]

  • {{str find0|abcdef|abc}} → 0
  • {{str find0|abcdef|def}} → 3
  • {{str find0|abcdef|ghi}} → -1
  • {{str find0|abcdef|abcdefghi}} → -1

আরও দেখুন[সম্পাদনা]

টেমপ্লেট:String templates see also