← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #193332]: find word in some string

 

Question #193332 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/193332

    Status: Open => Answered

RaiMan proposed the following answer:
str.find()
returns the position of the searched string in the given string between 0 and len(str).
if not found, returns -1.

so if str.find(): does not work.

If you only ant to know, that it exists:

if -1 < texto.find('gol'): # True if found

or

if (texto.count('gol'): # 0 if not found, which is False

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.