concat

Concatenate strings.

Description

  • Concatenate strings.

  • list of string can be passed.

Parameters

Parameter

Type

Required

Default

Comment

first

str|list[str]

Yes

-

string or list of strings to be concatnate before second parameter

out_bb

bool

No

False

If this parameter is set to True, the data is stored in the blackboard rather than in the flowdata.

By default, the key in the blackboard is set to the node name. To customize the key, specify the out_field parameter.

out_field

str

No

None

The key for the data in the blackboard. If out_bb is set to False, this parameter is ignored.

second

str|list[str]

Yes

-

string or list of strings to be concatnate after first parameter

Examples

# Concatenate the 2 strings.
# Output: {'concat': 'head1:pv1'}
- concat:
    name: "concat"
    first: "head1:"
    second: "pv1"

# Concatenate the 1 string and 1 list of string.
# Output: {'concat': ['head1:pv1', 'head1:pv2']}
- concat:
    name: "concat"
    first: "head1:"
    second: ["pv1", "pv2"]

# Concatenate the 2 list of string.
# Output: {'concat': ['head1:pv1', 'head2:pv2']}
- concat:
    name: "concat"
    first: ["head1:", "head2:"]
    second: ["pv1", "pv2"]

# Concatenate the 2 list of string, but length is different.
# Output: {'concat': ['head1:pv1', 'head2:pv2']}
- concat:
    name: "concat"
    first: ["head1:", "head2:", "head3:"]
    second: ["pv1", "pv2"]

# Concatenate the 2 strings and output to the blackboard.
# Output: {'foo': 'head1:pv1'}
- concat:
    name: "concat"
    first: "head1:"
    second: "pv1"
    out_bb: yes
    out_field: "foo"