Ah sorry the example showed indexof as an integer thats why it did not make sense.
Trim can clean this up too yeah.
Yeah i figured out that i dont need to skik anything and works fine like this:
if (readString.startsWith("off")) {
So its basicly the same as:
if(readString.indexOf("on") >=0) {
Why the ">=0"?
So it works, now i just have to send it wireless, some going wrong there but at least the code is working now.