Mwnci partition() Function

Syntax

partition(string)

Description

The partition() function searches for a specified string, and splits the string into an array of three elements.

The first element contains the part before the specified string.

The second element contains the specified string.

The third element contains the part after the string.

Example

include("string")
println(partition("I say foobar for fun", "foobar"))


["I say ", "foobar", " for fun"]