BUCL.io / implode
Verbindet mehrere Texte zu Einem.
Beispiel
{res} implode "," "one" "two" "three"
Quellcode
#implode #description: Concats multiple texts into one. #description-DE: Verbindet mehrere Texte zu Einem. #sample: {res} implode "," "one" "two" "three" #to test direct: {input} = "," "we" "are" "simple" "texts" #read input numbered and named {glue} = "" {parts} = {input} {inputCount} count {input} if {inputCount} >= 2 {glue} = {input/0} {parts} slice 1 0 {input} if {input/glue} {glue} = {input/glue} if {input/parts} {parts} = {input/parts} #make flat numeric list of all parameters (incl. named onces) {flat} = "" {loop} each {parts} if {loop/first} {flat} = {loop/value} else {flat} = {flat} {loop/value} {result} = "" {loop} each {flat} if {loop/first} {result} = {loop/value} else {result} = "{result}{glue}{loop/value}" {output} = {result}