ค้นหาในปลั๊กอินสำหรับไพธอนอยู่ในข้อความ

รหัสตัวอย่าง

61
0

ค้นหาข้อความในข้อความเป็นภาษาไพธอน

>>> str = "Messi is the best soccer player"
>>> "soccer" in str
True
>>> "football" in str
False
0
0

ปลั๊กอินสำหรับไพธอนข้อความหา

The find() method returns the index of first occurrence of the substring
(if found). If not found, it returns -1.
message = 'Python is a fun programming language'

# check the index of 'fun'
print(message.find('fun'))

# Output: 12

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังหน้ากับตัวอย่างอยู่ในหมวดหมู่