Datatype Conversions


(Jack) #1

Hi,
So I have String descMap.value of “aa01e2e6” (this value is not constant). And I need to split the first 2 digits from the rest so that I can get “aa” and “01e2e6”. Then I need to convert the “aa” to hex so that I get “170”. How can I do this in SmartThings programming?


(Arn B) #2

A link and a search that may help.

https://www.tutorialspoint.com/groovy/groovy_substring.htm


(vlad) #3

Here you go: https://groovyconsole.appspot.com/script/5201035375149056