OSDev.org
https://forum.osdev.org/

Examples for string find() in Python
https://forum.osdev.org/viewtopic.php?f=13&t=56329
Page 1 of 1

Author:  OptymizeSo [ Tue Jun 21, 2022 3:02 am ]
Post subject:  Examples for string find() in Python

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/