mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-13 18:02:59 -05:00
Convert single backtick code sections to triple backtick code sections for Arabic Guide articles (13 of 15) (#36240)
* fix: converted single to triple backticks13 * fix: added prefix Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: removed language in wrong place Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: add language postfix Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com> * fix: removed language in wrong place Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@@ -10,24 +10,26 @@ localeTitle: طريقة قطاع سترينج
|
||||
|
||||
مثال:
|
||||
|
||||
`>>> string = ' Hello, World! '
|
||||
>>> strip_beginning = string.lstrip()
|
||||
>>> strip_beginning
|
||||
'Hello, World! '
|
||||
>>> strip_end = string.rstrip()
|
||||
>>> strip_end
|
||||
' Hello, World!'
|
||||
>>> strip_both = string.strip()
|
||||
>>> strip_both
|
||||
'Hello, World!'
|
||||
`
|
||||
```py
|
||||
>>> string = ' Hello, World! '
|
||||
>>> strip_beginning = string.lstrip()
|
||||
>>> strip_beginning
|
||||
'Hello, World! '
|
||||
>>> strip_end = string.rstrip()
|
||||
>>> strip_end
|
||||
' Hello, World!'
|
||||
>>> strip_both = string.strip()
|
||||
>>> strip_both
|
||||
'Hello, World!'
|
||||
```
|
||||
|
||||
يمكن تقديم وسيطة اختيارية كسلسلة تحتوي على كل الحروف التي ترغب في تجريدها.
|
||||
|
||||
`>>> url = 'www.example.com/'
|
||||
>>> url.strip('w./')
|
||||
'example.com'
|
||||
`
|
||||
```py
|
||||
>>> url = 'www.example.com/'
|
||||
>>> url.strip('w./')
|
||||
'example.com'
|
||||
```
|
||||
|
||||
ومع ذلك ، هل لاحظ أن الأول فقط `.` جردت من الخيط ويرجع ذلك إلى أن وظيفة `strip` فقط بتمييز أحرف الوسيطة الموجودة على اليسار أو أقصى اليمين. منذ w يأتي قبل الأول `.` يتم تجريدهم معا، بينما "com" موجود في النهاية الصحيحة قبل `.` بعد تجريد `/`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user