2

Auto trim array elements (global, optional)

Hi Joao,

for readability or in unknown input, in Variable Set or Array Set, we often have elements with leading or trailing spaces:

5, 23, 14.745 ,  12

A very common technique we probably have to deal with, at least I do it this way, is to variable split with Regex (\s*,\s*). If array elements have been created with Array Set, we may need to do a Search/Replace of whitespace in the array elements.

IDEA: Let Tasker trim leading and trailing whitespace from array variables on creation and assignment. This should be a global option and initially turned off, for compatibility reasons of course.

Would be another nice helper!

1 reply

BA

Yes, I'd love to have a "strip spaces" option in Array Set too. ...Have just spent hours wondering why the "If %arr(1) ~ somestring" statement never fired - argh, a whitespace as first character of the array element :-)