How to cut string from region of picture?

Asked by jackcyh on 2018-07-24

Dear sir

I want to cut string for example as following:

"2.45%"

after cut "%"

It existed finally "2.45"

How can I do it?

Thank you for your help.

Best-Regards
Jack

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-07-25
Last reply:
2018-07-25
masuo (masuo-ohara) said : #1

Do you use Python ?
When you use Python in the script and you want to edit strings, you have to search Python documentation.
for example, https://docs.python.org/2/library/string.html

[example]
s = "2.45%"
print s
print s.strip("%")

jackcyh (jackcyh) said : #2

I use "Sikuli IDE"

The string object has no strip function, so I cannot use it to cut "%".
It still has no substring function in Sikuli IDE, too.

Can you give another solution? Thank you.

Best-Regards
Jack

RaiMan (raimund-hocke) said : #3

what masuo says in comment #1 is exactly how it is:

Using Sikuli IDE in the standard, means scripting in Python language (level 2.7).

Read the docs and understand what you are doing.

Can you help with this problem?

Provide an answer of your own, or ask jackcyh for more information if necessary.

To post a message you must log in.