ady624 / CoRE

CoRE - Community's own Rule Engine
GNU General Public License v3.0
222 stars 663 forks source link

Feature Request: Variable string manipulation #31

Open CAL77 opened 8 years ago

CAL77 commented 8 years ago

String manipulation could get crazy, but all that I find necessary would be conversion of a string value to a number for additional arithmetic and evaluations.

https://community.smartthings.com/t/smart-weather-station-tile-app/2710/129?u=cal7

Is it containing words followed by the number? Perhaps I can modify CoRE's casting function to "extract" all digits from the string and convert them to a number?

ady624 commented 8 years ago

Casting is automatic when you try to do math. All parameters are cast to the the selected type (which is the reason I ask of the variable type in the Set Variable). Have you tried that?

Oh, you mean, pick all the digits in a string and parse a number out of it. Got it.