Houdini 21.0 Nodes APEX nodes

string::Partition

Splits a string at the first or last instance of a partition substring.

On this page
Since 21.0

Finds the first or last instance of a partition substring within a string, and returns the string before and the string after the partition.

If last is set to False, the string is split on the first instance of the partition. If no such partition exists, before is the entire string and after is empty.

If last is set to True, the string is split on the last instance of the partition. If no such partition exists, before is the empty string and after is the entire string.

Inputs

string: String

The input string to partition.

partition: String

The substring on which to partition string.

last: Bool

If set to True, string is split on the last instance of partition. Otherwise, string is split on the first instance of partition.

Outputs

before: String

The part of the string before the partition.

after: String

The part of the string after the partition.

See also

APEX nodes