الگو:Str sub find/doc: تفاوت میان نسخهها
از اسلامشناسان
کنشهای بیشتر
imported>Jdaloner جز Updated transclusion of navbox. |
imported>Adminm جز ۱ نسخه واردشده |
(بدون تفاوت)
| |
نسخهٔ کنونی تا ۲۰ فوریهٔ ۲۰۱۸، ساعت ۱۳:۴۷
خطای لوا: روند نتوانست ایجاد شود: proc_open(/dev/null): Failed to open stream: Operation not permitted خطای لوا: روند نتوانست ایجاد شود: proc_open(/dev/null): Failed to open stream: Operation not permitted The Template:str_sub_find searches for a substring in a string at the given offset.
Usage
{{str sub find|<string1>|<string2>|<offset>}}
It returns 1, if string2 is found in string1 at the given offset, otherwise it will return empty string. This makes the result easy usable in Help:Extension:ParserFunctions like {{#if:|}}.
Offset is zero-based and can be omitted if zero.
Examples
- {{#if: {{str sub find|abcdef|abc}} | Substring is found | Substring is not found }} → Substring is not found
- {{#if: {{str sub find|abcdef|abc|2}} | Substring is found | Substring is not found }} → Substring is not found
- {{#if: {{str sub find|abcdef|def}} | Substring is found | Substring is not found }} → Substring is not found
- {{#if: {{str sub find|abcdef|def|3}} | Substring is found | Substring is not found }} → Substring is not found
See also
خطای لوا: روند نتوانست ایجاد شود: proc_open(/dev/null): Failed to open stream: Operation not permitted