HTTP Binding - Parsing result


could someone give me an advice how to parse this string


The 1st letter could change and i need it too.
each of the trailing digits represents one (physical) state (0/1)

how do i parse it to set multiple items (in one rule) to it’s corresponding state?

regards & thanks

val fullString = "S#"
val splitStr = fullString.split("\#|\.") // returns an array of the parts of the String separated by # and .

val firstLetter = splitStr.get(0)
val dev0 = splitStr.get(1)
val dev1 = splitStr.get(2)
val dev14 = splitStr.get(15)

ah, thanks man.

it is very interesting, that split works with # and . at the same time …

in OH 1.8.3 split("#|.") doesn’t work …

Could not invoke method: org.apache.commons.lang.StringUtils.split(java.lang.String,java.lang.String) on instance: null

now i solved it with substring because split(".") or split(".") didn’t work.