I am trying to grab every other character in a very long variable, and placing it in another variable. This is what I have:
set_fact:
new_string: "{{ [ 0,2,4,6,8,10,12 ] | map('extract', verylongvariable) }}"
I've also tried this:
set_fact:
new_string: "{{ [ 0,2,4,6,8,10,12 ] | map('extract', verylongvariable) }} | map('join', ',' | join('')) }}
What I end up getting in the new_string is this:
'N', 'y', 'a', 'd'....
What I want is:
Nyad....
I clearly am not understanding the join syntax. How do I use join to get the new variable?