How can I find the first occurrence of a sub-string in a python string?

前端 未结 5 706
清歌不尽
清歌不尽 2020-12-14 05:29

So if my string is \"the dude is a cool dude\".
I\'d like to find the first index of \'dude\':

mystring.findfirstindex(\'dude\') # should return 4
         


        
5条回答
提交回复
热议问题