fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@@ -0,0 +1,31 @@
---
title: String Find Method
localeTitle: طريقة البحث عن سلسلة
---
## طريقة البحث عن سلسلة
هناك خياران للعثور على سلسلة فرعية داخل سلسلة في Python ، `find()` و `rfind()` .
كل سوف يعود الموقف الذي تم العثور على سلسلة فرعية في. الفرق بين الاثنين هو أن `find()` ترجع الموضع الأدنى ، و `rfind()` ترجع أعلى موضع.
يمكن توفير وسيطات البدء والانتهاء الاختيارية للحد من البحث عن السلسلة الفرعية داخل أجزاء من السلسلة.
مثال:
`>>> string = "Don't you call me a mindless philosopher, you overweight glob of grease!"
>>> string.find('you')
6
>>> string.rfind('you')
42
`
إذا لم يتم العثور على السلسلة الفرعية ، يتم إرجاع -1.
`>>> string = "Don't you call me a mindless philosopher, you overweight glob of grease!"
>>> string.find('you', 43) # find 'you' in string anywhere from position 43 to the end of the string
-1
`
معلومات اكثر:
[وثائق](https://docs.python.org/3/library/stdtypes.html#string-methods) طرق سلسلة.