Datatype Conversions

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?

A link and a search that may help.

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

2 Likes

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

1 Like