AINSERT
Reference
Section titled “Reference”>> Reference, Discussion, & Example Applications:
Inserts any string delimiter “d” between characters of an array “a” with a selectable pace “p” and selectable starting point “i”.
Inputs:
Section titled “Inputs:”- a : array
- d : any string delimiter
- p : integer, pace width
- i : integer, index starting point, first delimiter will be placed in the ith position, or just after (i-1)th character, so for i ignored or i<=2, insert will start after 1st character
AINSERT = LAMBDA(a, d, p, i, LET( ld, LEN(d), k, MAX(p, 1), j, MAX(k + 1, i), n, MAX(LEN(a)), IF( n < (j - 1), SUBSTITUTE(TRIM(SUBSTITUTE(a, d, " ")), " ", d), AINSERT( REPLACE(a, j, , d), d, k, j + 2 * (k + 1) - k - 1 + ld - 1 ) ) ));