I would like to return, if one exists, the match between a single string and a string array, or slice. if it doesn’t exist, it just skips or returns blank. Basically acts like a failed with
function.
Specifically, in a shortcode, I have a named argument p
and I want to compare if its contents match a slice of {{ slice "center" "left" "right" }}
I thought intersect
would be what I want but I’m getting error calling intersect: can't iterate over string
.
I also tried in
and that returns true or false and it works but it also means I need extra lines to flesh out the rest, instead of just working with the match itself.