; $[reptok] - Sight
; ;; What this is ;;
; $[reptok] is basically a position based token replacer
; ;; Syntax ;;
; $[reptok](,,,C) or $[reptok](,,,C).a
; ;; Examples ;;
; $[reptok](1 2 3 4,3,5,32) returns 1 2 5 4
; $[reptok](1 2 1 3 4,1,4,32).a returns 4 2 4 3 4
; $[reptok] - Sight
; ;; What this is ;;
; $[reptok] is basically a position based token replacer
; ;; Syntax ;;
; $[reptok](<string>,<N>,<New token>,C) or $[reptok](<string>,<Delimeter>,<New token>,C).a
; ;; Examples ;;
; $[reptok](1 2 3 4,3,5,32) returns 1 2 5 4
; $[reptok](1 2 1 3 4,1,4,32).a returns 4 2 4 3 4
alias [reptok] {
if (!$prop) return $iif(!$$1 || !$2-4 || $gettok($$1,$2,$4) = $3,$false,$instok($deltok($$1,$2,$4),$3,$2,$4)))
if ($prop = a) {
if (!$$1 || !$2-4) { return $false }
else {
var %c = $$1
while ($findtok(%c,$2,$4)) { var %c = $reptok(%c,$gettok($$1,$ifmatch,$4),$3,$4) }
return %c
}
}
else return $false
}