OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:33 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Examples for string find() in Python
PostPosted: Tue Jun 21, 2022 3:02 am 
Offline

Joined: Tue Jun 21, 2022 2:59 am
Posts: 1
I am trying to find some examples but no luck.

Does anyone know of some examples on the net? I would like to know what it returns when it can't find, and how to specify from start to end, which I guess is going to be 0, -1.

From Scaler I got the below resolution, but still unsure about it. Need your valuable insights.

Code:
>>> x = "Hello World"
>>> x.find('World')
6
>>> x.find('Aloha');
-1


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group