3 replies

RR

You could also use a For loop:

        Test
        
    A1: Array Set 
        Variable Array: %code 
        Values: A,a,b,b 
        Splitter: , 
        
    A2: For 
        Variable: %index 
        Items: 1:%code(#) 
        
    A3: Array Push 
        Variable Array: %indexes 
        Position: 1 
        Value: %index 
        Fill Spaces: Off
        If %code(%index) ~R a
        
    A4: End For 
        
    A5: Flash 
        Text: %indexes() 
        Long: Off 
FD

I must change the letter in the same position. Creating a new array will place them in the wrong places.

The (#?UPPERCASE) works.

FD

Damn! I have KitKat with Tasker 4.9.

The (#?~R) was implemented with 5.0 and the (#?) is not case sensitive with 4.9 if letters are in lowercase, just like pattern matching.

 
The example is not exactly what i do, it's so you can see what i want and what happens.
 
A1: Array Set [ Variable Array:%code Values:A,a,b,b Splitter:, ] 
A2: Array Set [ Variable Array:%indexes Values:%code(#?a) Splitter:, ] 
A3: Flash [ Text:%indexes() Long:Off ] 
 
It returns (1,2) and it should/i want it to return (2).
 
EDIT:
Thinking about it, i can set letters in the array in uppercase and convert them to lowercase, so the %code(#?A) will be case sensitive.
RR

Can you give an example of what you want to do?

Array searches are already case sensitve, either through simple (#?) or regex (#?~R) pattern matching.