Delete blanks

Asked by fldptm

-----------------------------------------------------------
Raw : happy h a p p y

doubleClick()
type('c',Key.CTRL)
box1=Env.getClipboard().strip().encode("utf-8")
print(box1)

box1 : happy h a p p y
-----------------------------------------------------------

I'd like to erase all the blanks of the content 'as marked below' and make them like the letters below.
" happy h a p p y" -> "happyhappy"

I've written the code but it doesn't work.

You may have made a mistake in coding to copy the character and then delete the space in the resulting value.

I'm not sure about the code to delete blanks. Please help.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

I suggest using the python function string.replace
https://www.w3schools.com/python/ref_string_replace.asp

Can you help with this problem?

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

To post a message you must log in.