Skip to content

Concat 1.0.0

Overview

Function Beginner

Version Source

Description

A versatile concatenation block that intelligently combines two sequences of the same type. Supports both string concatenation and list merging with smart empty-sequence handling that preserves non-empty content when one input is empty.

Configuration Options

No configuration options available.

Inputs

NameData TypeDescription
aSequenceTFirst sequence to concatenate. Can be a string or list. Must be the same type as input 'b'.
bSequenceTSecond sequence to concatenate. Can be a string or list. Must be the same type as input 'a'.

Outputs

NameData TypeDescription
resultSequenceTThe concatenated sequence combining inputs 'a' and 'b'. For lists, empty inputs are intelligently handled.

Examples

# String concatenation
name: join_text
type: Concat
inputs:
  a: "Hello, "
  b: "World!"
outputs:
  result: "greeting_message"

Error Handling

Type Mismatch Error

Error Code
TypeError
Common Cause
Attempting to concatenate different types (e.g., string + list)
Solution
Ensure both inputs are the same type - either both strings or both lists. Use type conversion blocks if needed.

Unsupported Type Error

Error Code
TypeError
Common Cause
Trying to concatenate types other than strings or lists
Solution
Convert inputs to strings or lists before concatenation, or use appropriate blocks for other data types

FAQ

How does empty list handling work?

For lists, if input 'a' is empty, the result is 'b'. If input 'b' is empty, the result is 'a'. If both have content, they are merged normally. This prevents unnecessary empty list pollution in results.

Can I concatenate more than two sequences?

Concat only handles two inputs at a time. To concatenate multiple sequences, chain multiple Concat blocks together or use JoinStrings for multiple strings with separators.

What happens with empty strings?

Empty strings are concatenated normally without special handling. For example, "" + "hello" results in "hello", and "hello" + "" results in "hello".

Can I concatenate nested lists?

Yes, Concat works with nested lists and preserves the structure. It combines the top-level lists, so [[1,2], [3,4]] + [[5,6]] becomes [[1,2], [3,4], [5,6]].

How do I concatenate strings with separators?

Concat joins strings directly without separators. To add separators, use CreateList to group your strings, then use JoinStrings with the desired separator.

What's the performance impact for large sequences?

For very large lists or strings, concatenation creates a new object in memory. Monitor memory usage and consider streaming approaches for extremely large datasets.