Skip to main content

chunk

Split a string into two parts at the input index.

def chunk(
data: string,
index: integer
) - > tuple

Split a string into two parts at the input index.

Parameters

NameTypeDescription
datastringThe source string to be partitioned into two segments
indexintegerThe character position at which the string will be split

Returns

TypeDescription
tupleA tuple containing the first part of the string up to the index and the second part from the index to the end