Hi,
I’m trying to migrate my rules to OH3.
While with DateTime Conversion (openHAB 3.x) there’s quite a good article how to overcome the time conversion issues, I struggle to get my rules working similar when it comes to string manipulation.
Unfortunately, it hasn’t been mentioned that String class apparently isn’t the same as before.
At least for me, OH3 complains about:
The method substringAfter(String) is undefined for the type String
The method substringBefore(String) is undefined for the type String
The method startsWithIgnoreCase(String) is undefined for the type String
Am I just missing some import, or do you have any other tips for me?
I have the same question / problem.
I was already looking for the correct namespace to import but my research was not successful. The namespace “org.apache.commons.lang3.StringUtils” is not working for StringUtils.
So, is there someone who knows already the correct namespace?
Is it possible to use substringAfter and some other StringUtils functions anymore in OH3?
Thank you for your answer!
Of course you can use built in functions from String class, but the code it is much more “complex”. The StringUtils class was very easy.
Now it seems that you have to build your own scripts/functions or have to write more complex rules as it was with e.g. substringAfter …