Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python string find

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
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #string #find
ADD COMMENT
Topic
Name
6+3 =